diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-05-25 15:51:07 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-05-25 15:51:29 +0300 |
commit | a072a264b680068ec7575240da3002b4ad9d62f6 (patch) | |
tree | 72a3dfa8d9f2ab03069d351ef21a3932f77c122d /source/blender/draw | |
parent | c27be07d896a5537ff17656af2519068781498a8 (diff) |
Fix vertex format for mesh attributes with GPU subdivision
A global variable was mistakenly used here which would accumulate the
vertex attributes (leading to an assertion failure after a while), use
the wrong number of components depending on the attribute data type,
among other issues.
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc index f9e58709c6e..497cde9aaf2 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc @@ -346,7 +346,7 @@ static void extract_attr_init_subdiv(const DRWSubdivCache *subdiv_cache, /* Prepare VBO for coarse data. The compute shader only expects floats. */ GPUVertBuf *src_data = GPU_vertbuf_calloc(); - static GPUVertFormat coarse_format = {0}; + GPUVertFormat coarse_format = {0}; GPU_vertformat_attr_add(&coarse_format, "data", GPU_COMP_F32, dimensions, GPU_FETCH_FLOAT); GPU_vertbuf_init_with_format_ex(src_data, &coarse_format, GPU_USAGE_STATIC); GPU_vertbuf_data_alloc(src_data, static_cast<uint32_t>(coarse_mesh->totloop)); |