[Bf-blender-cvs] [af72fc75559] master: DRW: Fix State tracking being off when calling GPU_framebuffer_clear

Clément Foucault noreply at git.blender.org
Wed Mar 6 03:38:59 CET 2019


Commit: af72fc75559e059a7d8e91f2b203efbb3b01f8c6
Author: Clément Foucault
Date:   Wed Mar 6 02:40:36 2019 +0100
Branches: master
https://developer.blender.org/rBaf72fc75559e059a7d8e91f2b203efbb3b01f8c6

DRW: Fix State tracking being off when calling GPU_framebuffer_clear

State tracking works in pretty much all cases but calling the clear command
does change the write mask outside the draw manager. For now we just reset
the write mask before each pass.

Fix T62203 The selected bone is not highlighted inside the other bone.

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

M	source/blender/draw/intern/draw_manager_exec.c

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

diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c
index e6248b70df5..2e8ba259a31 100644
--- a/source/blender/draw/intern/draw_manager_exec.c
+++ b/source/blender/draw/intern/draw_manager_exec.c
@@ -1315,6 +1315,10 @@ static void drw_draw_pass_ex(DRWPass *pass, DRWShadingGroup *start_group, DRWSha
 
 	drw_update_view();
 
+	/* GPU_framebuffer_clear calls can change the state outside the DRW module.
+	 * Force reset the affected states to avoid problems later. */
+	drw_state_set(DST.state | DRW_STATE_WRITE_DEPTH | DRW_STATE_WRITE_COLOR);
+
 	drw_state_set(pass->state);
 
 	DRW_stats_query_start(pass->name);



More information about the Bf-blender-cvs mailing list