Fix T81002: Images drawn with the Python gpu module no longer draw on top in the Image Editor

This reverts commit 32d4a67017 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
This commit is contained in:
Germano Cavalcante
2022-09-05 11:48:06 -03:00
committed by Germano Cavalcante
parent 44619eaa32
commit 89abc14d6c
2 changed files with 11 additions and 2 deletions

View File

@@ -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

View File

@@ -10,6 +10,5 @@ out vec2 texCoord_interp;
void main()
{
gl_Position = ModelViewProjectionMatrix * vec4(pos.xy, 0.0f, 1.0f);
gl_Position.z = 1.0;
texCoord_interp = texCoord;
}