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>2021-11-15 04:39:33 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2021-11-15 04:39:33 +0300
commitc2c65cc4bf9467c180387ae791bd4fe3e7fbba8c (patch)
tree0be906066bc5e381ccbcfb9d85573ec93402f83d
parent7e82c840b7a43b0594ba274c745f3049e0148d12 (diff)
parent622e6f05f1b5fb1db326dca647a2cbd56ca6b573 (diff)
Merge branch 'blender-v3.0-release'
-rw-r--r--source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_attributes.cc12
1 files changed, 12 insertions, 0 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 9edefe32fbc..8a5a8134ca7 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
@@ -172,6 +172,18 @@ static void init_vbo_for_attribute(const MeshRenderData *mr,
GPUVertFormat format = {0};
GPU_vertformat_deinterleave(&format);
GPU_vertformat_attr_add(&format, attr_name, comp_type, comp_size, fetch_mode);
+
+ /* Ensure Sculpt Vertex Colors are properly aliased. */
+ if (request.cd_type == CD_PROP_COLOR && request.domain == ATTR_DOMAIN_POINT) {
+ CustomData *cd_vdata = get_custom_data_for_domain(mr, ATTR_DOMAIN_POINT);
+ if (request.layer_index == CustomData_get_render_layer(cd_vdata, CD_PROP_COLOR)) {
+ GPU_vertformat_alias_add(&format, "c");
+ }
+ if (request.layer_index == CustomData_get_active_layer(cd_vdata, CD_PROP_COLOR)) {
+ GPU_vertformat_alias_add(&format, "ac");
+ }
+ }
+
GPU_vertbuf_init_with_format(vbo, &format);
GPU_vertbuf_data_alloc(vbo, static_cast<uint32_t>(mr->loop_len));
}