[Bf-blender-cvs] [cc1ba74ce2f] master: Fix T102966: Curves editmode selection drawing not stable / flickering

Philipp Oeser noreply at git.blender.org
Wed Dec 7 09:42:39 CET 2022


Commit: cc1ba74ce2f245349bd04a996c44e04260d49825
Author: Philipp Oeser
Date:   Tue Dec 6 13:57:41 2022 +0100
Branches: master
https://developer.blender.org/rBcc1ba74ce2f245349bd04a996c44e04260d49825

Fix T102966: Curves editmode selection drawing not stable / flickering

Issue was the lifetime of GPUVertFormat & GPUVertAttr.
Both need to be static in the function to be persistent here (and
handled appropriately).

Was an error in rB319ee296fd0c.

Maniphest Tasks: T102966

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

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

M	source/blender/draw/intern/draw_cache_impl_curves.cc

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

diff --git a/source/blender/draw/intern/draw_cache_impl_curves.cc b/source/blender/draw/intern/draw_cache_impl_curves.cc
index 0322d048fa5..1fc4d2e1f91 100644
--- a/source/blender/draw/intern/draw_cache_impl_curves.cc
+++ b/source/blender/draw/intern/draw_cache_impl_curves.cc
@@ -289,7 +289,11 @@ static void curves_batch_cache_ensure_data_edit_points(const Curves &curves_id,
   const bke::CurvesGeometry &curves = bke::CurvesGeometry::wrap(curves_id.geometry);
 
   static GPUVertFormat format_data = {0};
-  uint data = GPU_vertformat_attr_add(&format_data, "data", GPU_COMP_U8, 1, GPU_FETCH_INT);
+  static uint data;
+  if (format_data.attr_len == 0) {
+    data = GPU_vertformat_attr_add(&format_data, "data", GPU_COMP_U8, 1, GPU_FETCH_INT);
+  }
+
   GPU_vertbuf_init_with_format(cache.data_edit_points, &format_data);
   GPU_vertbuf_data_alloc(cache.data_edit_points, curves.points_num());



More information about the Bf-blender-cvs mailing list