diff options
author | Pablo Dobarro <pablodp606@gmail.com> | 2020-06-24 17:45:17 +0300 |
---|---|---|
committer | Pablo Dobarro <pablodp606@gmail.com> | 2020-06-24 18:27:53 +0300 |
commit | 2b522e3345a490ff8ad387ed4f2214e32b7dac57 (patch) | |
tree | 4ac0a02748b24aa757281215b6142f3bae2f0fde | |
parent | 0f7851ee79bdcd39b475633b5f65c31aa5370a23 (diff) |
Fix T78188: Sculpt mask glitching after using sculpt vertex colors
The face sets color copy to the GPU was done outside of the loop,
probably after a merge error in a rebase.
Also, the default color was initialized using the wrong type.
Reviewed By: sergey
Maniphest Tasks: T78188
Differential Revision: https://developer.blender.org/D8106
-rw-r--r-- | source/blender/gpu/intern/gpu_buffers.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/gpu/intern/gpu_buffers.c b/source/blender/gpu/intern/gpu_buffers.c index 53ef305f629..9c21f9040da 100644 --- a/source/blender/gpu/intern/gpu_buffers.c +++ b/source/blender/gpu/intern/gpu_buffers.c @@ -316,7 +316,7 @@ void GPU_pbvh_mesh_buffers_update(GPU_PBVH_Buffers *buffers, empty_mask = empty_mask && (cmask == 0); /* Vertex Colors. */ if (show_vcol) { - ushort scol[4] = {1.0f, 1.0f, 1.0f, 1.0f}; + ushort scol[4] = {USHRT_MAX, USHRT_MAX, USHRT_MAX, USHRT_MAX}; if (vtcol) { scol[0] = unit_float_to_ushort_clamp(vtcol[vtri[j]].color[0]); scol[1] = unit_float_to_ushort_clamp(vtcol[vtri[j]].color[1]); @@ -334,10 +334,9 @@ void GPU_pbvh_mesh_buffers_update(GPU_PBVH_Buffers *buffers, memcpy(GPU_vertbuf_raw_step(&col_step), scol, sizeof(scol)); } } + /* Face Sets. */ + memcpy(GPU_vertbuf_raw_step(&fset_step), face_set_color, sizeof(uchar) * 3); } - - /* Face Sets. */ - memcpy(GPU_vertbuf_raw_step(&fset_step), face_set_color, sizeof(uchar) * 3); } } |