From 9cc9db87bbccf2b8648afa0db5af8240ec41c2c9 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 27 Apr 2018 18:46:16 +0200 Subject: [PATCH] Fix missing action zones and emboss in the 3D viewport. Not really happy with the fix, but it works. With the new window draw method we are no longer storing the 3D viewport in 4 buffers, by having the GPU viewport function directly as the 3rd buffer. This means we need to draw the action zones into it, and so we need to keep the framebuffer bound a little longer. --- source/blender/draw/intern/draw_manager.c | 9 ++++++++- source/blender/gpu/intern/gpu_viewport.c | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 6e8f9d50aae..196f817a636 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -1295,7 +1295,14 @@ void DRW_draw_render_loop_ex( glEnable(GL_DEPTH_TEST); } - GPU_framebuffer_restore(); + if (WM_draw_region_get_bound_viewport(ar)) { + /* Don't unbind the framebuffer yet in this case and let + * GPU_viewport_unbind do it, so that we can still do further + * drawing of action zones on top. */ + } + else { + GPU_framebuffer_restore(); + } DRW_state_reset(); drw_engines_disable(); diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c index 383ebec5b72..dc898c85773 100644 --- a/source/blender/gpu/intern/gpu_viewport.c +++ b/source/blender/gpu/intern/gpu_viewport.c @@ -548,6 +548,7 @@ void GPU_viewport_draw_to_screen(GPUViewport *viewport, const rcti *rect) void GPU_viewport_unbind(GPUViewport *UNUSED(viewport)) { + GPU_framebuffer_restore(); DRW_opengl_context_disable(); }