[Bf-blender-cvs] [7b690619ddd] master: CleanUp: Fixed incorrect parameters to GPU_depth_test

Jeroen Bakker noreply at git.blender.org
Tue Sep 15 10:16:41 CEST 2020


Commit: 7b690619ddd8b12f0c722ef26bab1abc72edb53e
Author: Jeroen Bakker
Date:   Tue Sep 15 10:15:54 2020 +0200
Branches: master
https://developer.blender.org/rB7b690619ddd8b12f0c722ef26bab1abc72edb53e

CleanUp: Fixed incorrect parameters to GPU_depth_test

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

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 834505ca349..835f0808d44 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -2097,31 +2097,26 @@ void DRW_draw_render_loop_2d_ex(struct Depsgraph *depsgraph,
     GPU_framebuffer_bind(dfbl->overlay_fb);
 
     if (do_annotations) {
-      GPU_depth_test(false);
+      GPU_depth_test(GPU_DEPTH_NONE);
       GPU_matrix_push_projection();
       wmOrtho2(
           region->v2d.cur.xmin, region->v2d.cur.xmax, region->v2d.cur.ymin, region->v2d.cur.ymax);
       ED_annotation_draw_view2d(DST.draw_ctx.evil_C, true);
       GPU_matrix_pop_projection();
-
-      GPU_depth_test(true);
     }
 
-    GPU_depth_test(false);
+    GPU_depth_test(GPU_DEPTH_NONE);
     ED_region_draw_cb_draw(DST.draw_ctx.evil_C, DST.draw_ctx.region, REGION_DRAW_POST_VIEW);
-    GPU_depth_test(true);
     /* Callback can be nasty and do whatever they want with the state.
      * Don't trust them! */
     DRW_state_reset();
 
-    GPU_depth_test(false);
+    GPU_depth_test(GPU_DEPTH_NONE);
     drw_engines_draw_text();
-    GPU_depth_test(true);
 
     if (do_annotations) {
-      GPU_depth_test(false);
+      GPU_depth_test(GPU_DEPTH_NONE);
       ED_annotation_draw_view2d(DST.draw_ctx.evil_C, false);
-      GPU_depth_test(true);
     }
   }
 
@@ -2129,21 +2124,21 @@ void DRW_draw_render_loop_2d_ex(struct Depsgraph *depsgraph,
   ED_region_pixelspace(DST.draw_ctx.region);
 
   {
-    GPU_depth_test(false);
+    GPU_depth_test(GPU_DEPTH_NONE);
     DRW_draw_gizmo_2d();
-    GPU_depth_test(true);
   }
 
   DRW_stats_reset();
 
   if (G.debug_value > 20 && G.debug_value < 30) {
-    GPU_depth_test(false);
+    GPU_depth_test(GPU_DEPTH_NONE);
     /* local coordinate visible rect inside region, to accommodate overlapping ui */
     const rcti *rect = ED_region_visible_rect(DST.draw_ctx.region);
     DRW_stats_draw(rect);
-    GPU_depth_test(true);
   }
 
+  GPU_depth_test(GPU_DEPTH_LESS_EQUAL);
+
   if (WM_draw_region_get_bound_viewport(region)) {
     /* Don't unbind the framebuffer yet in this case and let
      * GPU_viewport_unbind do it, so that we can still do further
diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c
index bc3c30ea1c8..4a2ab30d74f 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -879,7 +879,7 @@ void GPU_viewport_unbind_from_offscreen(GPUViewport *viewport,
     return;
   }
 
-  GPU_depth_test(false);
+  GPU_depth_test(GPU_DEPTH_NONE);
   GPU_offscreen_bind(ofs, false);
 
   rctf pos_rect = {



More information about the Bf-blender-cvs mailing list