From 2b522e3345a490ff8ad387ed4f2214e32b7dac57 Mon Sep 17 00:00:00 2001 From: Pablo Dobarro Date: Wed, 24 Jun 2020 16:45:17 +0200 Subject: 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 --- source/blender/gpu/intern/gpu_buffers.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'source/blender/gpu') 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); } } -- cgit v1.2.3