[Bf-blender-cvs] [2b522e3345a] master: Fix T78188: Sculpt mask glitching after using sculpt vertex colors

Pablo Dobarro noreply at git.blender.org
Wed Jun 24 17:28:13 CEST 2020


Commit: 2b522e3345a490ff8ad387ed4f2214e32b7dac57
Author: Pablo Dobarro
Date:   Wed Jun 24 16:45:17 2020 +0200
Branches: master
https://developer.blender.org/rB2b522e3345a490ff8ad387ed4f2214e32b7dac57

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

===================================================================

M	source/blender/gpu/intern/gpu_buffers.c

===================================================================

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);
       }
     }



More information about the Bf-blender-cvs mailing list