diff options
author | Germano Cavalcante <mano-wii> | 2022-09-05 17:48:06 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2022-09-05 18:35:42 +0300 |
commit | 89abc14d6ce92dd5fd8cd32885d379d46f017f81 (patch) | |
tree | c1c81901d9f065d7a63e84734addd6c4fb8dedc3 /source/blender/draw/engines/external/external_engine.c | |
parent | 44619eaa32ceaa796f32ad2cea2b3a6c2259461d (diff) |
Fix T81002: Images drawn with the Python gpu module no longer draw on top in the Image Editor
This reverts commit 32d4a67017ecf4af75a9bfde885526550a6534ba thus fixing T81002 again.
And in order not to break T81212 (again) a different fix was implemented.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D15840
Diffstat (limited to 'source/blender/draw/engines/external/external_engine.c')
-rw-r--r-- | source/blender/draw/engines/external/external_engine.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/draw/engines/external/external_engine.c b/source/blender/draw/engines/external/external_engine.c index b9c09e2bc4f..3f047d8de68 100644 --- a/source/blender/draw/engines/external/external_engine.c +++ b/source/blender/draw/engines/external/external_engine.c @@ -236,7 +236,11 @@ static void external_draw_scene_do_v3d(void *vedata) RegionView3D *rv3d = draw_ctx->rv3d; ARegion *region = draw_ctx->region; - DRW_state_reset_ex(DRW_STATE_DEFAULT & ~DRW_STATE_DEPTH_LESS_EQUAL); + DRW_state_reset_ex(DRW_STATE_WRITE_COLOR); + + /* The external engine can use the OpenGL rendering API directly, so make sure the state is + * already applied. */ + GPU_apply_state(); /* Create render engine. */ if (!rv3d->render_engine) { @@ -332,6 +336,12 @@ static void external_draw_scene_do_image(void *UNUSED(vedata)) BLI_assert(re != NULL); BLI_assert(engine != NULL); + DRW_state_reset_ex(DRW_STATE_WRITE_COLOR); + + /* The external engine can use the OpenGL rendering API directly, so make sure the state is + * already applied. */ + GPU_apply_state(); + const DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); /* Clear the depth buffer to the value used by the background overlay so that the overlay is not |