diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-09-12 18:29:37 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-09-12 18:29:37 +0300 |
commit | bf3f4da9472516be12dcc69740fa69b6d72f1274 (patch) | |
tree | 8e8eaaee61d0570026c46eeeb8ea882146b04ca7 /source/blender/draw | |
parent | 6bc0a8424e9b794accf70534ed55478337f0e3e3 (diff) |
GPU: Fix wrong state before python callbacks
This was caused by a missing state apply.
We force the GPUState to be set after the callbacks to avoid
desync between our state tracker and the real gl state.
This fixes some issues but a better general fix for all BGL would
be better.
This fix T80297 2.91 texture alpha is not transparent
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 203f8af130d..834505ca349 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1365,6 +1365,8 @@ void DRW_draw_callbacks_pre_scene(void) if (DST.draw_ctx.evil_C) { ED_region_draw_cb_draw(DST.draw_ctx.evil_C, DST.draw_ctx.region, REGION_DRAW_PRE_VIEW); + /* Callback can be nasty and do whatever they want with the state. + * Don't trust them! */ DRW_state_reset(); } } @@ -1400,6 +1402,9 @@ void DRW_draw_callbacks_post_scene(void) drw_debug_draw(); GPU_depth_test(GPU_DEPTH_NONE); + /* Apply state for callbacks. */ + GPU_apply_state(); + ED_region_draw_cb_draw(DST.draw_ctx.evil_C, DST.draw_ctx.region, REGION_DRAW_POST_VIEW); /* Callback can be nasty and do whatever they want with the state. |