[Bf-blender-cvs] [9cc9db87bbc] blender2.8: Fix missing action zones and emboss in the 3D viewport.

Brecht Van Lommel noreply at git.blender.org
Fri Apr 27 18:53:23 CEST 2018


Commit: 9cc9db87bbccf2b8648afa0db5af8240ec41c2c9
Author: Brecht Van Lommel
Date:   Fri Apr 27 18:46:16 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9cc9db87bbccf2b8648afa0db5af8240ec41c2c9

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.

===================================================================

M	source/blender/draw/intern/draw_manager.c
M	source/blender/gpu/intern/gpu_viewport.c

===================================================================

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();
 }



More information about the Bf-blender-cvs mailing list