Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2022-05-25 15:51:07 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-05-25 15:51:29 +0300
commita072a264b680068ec7575240da3002b4ad9d62f6 (patch)
tree72a3dfa8d9f2ab03069d351ef21a3932f77c122d
parentc27be07d896a5537ff17656af2519068781498a8 (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.
-rw-r--r--source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc2
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));