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
This commit is contained in:
Philipp Oeser 2022-12-06 13:57:41 +01:00
parent 0b85d6a030
commit cc1ba74ce2
Notes: blender-bot 2023-02-14 07:39:44 +01:00
Referenced by issue #102966, Curves editmode: selection drawing not stable / flickering
1 changed files with 5 additions and 1 deletions

View File

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