[Bf-blender-cvs] [1b9d9cb1ed7] master: Fix T82164: Knife tool draws huge vertices after using bgl.glPointSize

Germano Cavalcante noreply at git.blender.org
Thu Nov 5 22:35:17 CET 2020


Commit: 1b9d9cb1ed7019e05b11cc480aef75a10e952957
Author: Germano Cavalcante
Date:   Thu Nov 5 17:14:09 2020 -0300
Branches: master
https://developer.blender.org/rB1b9d9cb1ed7019e05b11cc480aef75a10e952957

Fix T82164: Knife tool draws huge vertices after using bgl.glPointSize

Since it is possible to have multiple draw callbacks, (some of which
use bgl and others gpu), check and force the reset of the drawing status
at the end of each callback.

Differential Revision: https://developer.blender.org/D9476

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

M	source/blender/editors/space_api/spacetypes.c

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

diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index b89c8cb2193..40c83607f2c 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -276,13 +276,11 @@ void ED_region_draw_cb_draw(const bContext *C, ARegion *region, int type)
   for (rdc = region->type->drawcalls.first; rdc; rdc = rdc->next) {
     if (rdc->type == type) {
       rdc->draw(C, region, rdc->customdata);
-      has_drawn_something = true;
+
+      /* This is needed until we get rid of BGL which can change the states we are tracking. */
+      GPU_bgl_end();
     }
   }
-  if (has_drawn_something) {
-    /* This is needed until we get rid of BGL which can change the states we are tracking. */
-    GPU_bgl_end();
-  }
 }
 
 /* ********************* space template *********************** */



More information about the Bf-blender-cvs mailing list