[Bf-blender-cvs] [d582920e18a] temp-pbvh-texpaint-automasking: temp-pbvh-texpaint-automasking: Make requested patch changes

Joseph Eagar noreply at git.blender.org
Sun Oct 16 20:53:25 CEST 2022


Commit: d582920e18a9c95df90119b806bec3873cf8bce5
Author: Joseph Eagar
Date:   Fri Oct 14 20:49:05 2022 -0700
Branches: temp-pbvh-texpaint-automasking
https://developer.blender.org/rBd582920e18a9c95df90119b806bec3873cf8bce5

temp-pbvh-texpaint-automasking: Make requested patch changes

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

M	source/blender/blenkernel/BKE_pbvh.h
M	source/blender/blenkernel/intern/pbvh.c
M	source/blender/editors/sculpt_paint/sculpt_automasking.cc
M	source/blender/editors/sculpt_paint/sculpt_paint_image.cc

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

diff --git a/source/blender/blenkernel/BKE_pbvh.h b/source/blender/blenkernel/BKE_pbvh.h
index 0aec9565c2e..ba22091d1a1 100644
--- a/source/blender/blenkernel/BKE_pbvh.h
+++ b/source/blender/blenkernel/BKE_pbvh.h
@@ -561,7 +561,8 @@ typedef struct PBVHVertexIter {
   float (*vert_normals)[3];
 
   const bool *hide_vert;
-  int totvert, unique_verts_count;
+  int totvert;
+  int unique_vert_len;
   const int *vert_indices;
   float *vmask;
 
@@ -748,18 +749,6 @@ void BKE_pbvh_node_automasking_unmark(PBVH *pbvh, PBVHNode *node);
 bool BKE_pbvh_node_needs_automasking(PBVH *pbvh, PBVHNode *node);
 void BKE_pbvh_node_automasking_mark_all(PBVH *pbvh);
 
-/* XXX Temporary attribute for patch development; remove for final patch! */
-#ifdef __clang__
-#  define ATTR_NO_OPT __attribute__((optnone))
-#elif defined(_MSC_VER)
-#  define ATTR_NO_OPT __pragma(optimize("", off))
-#elif defined(__GNUC__)
-#  define ATTR_NO_OPT __attribute__((optimize("O0")))
-#else
-#  define ATTR_NO_OPT
-#endif
-
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c
index 1e4d9c301a3..dfa66e594f5 100644
--- a/source/blender/blenkernel/intern/pbvh.c
+++ b/source/blender/blenkernel/intern/pbvh.c
@@ -3081,7 +3081,7 @@ void pbvh_vertex_iter_init(PBVH *pbvh, PBVHNode *node, PBVHVertexIter *vi, int m
     vi->totvert = uniq_verts;
   }
 
-  vi->unique_verts_count = uniq_verts;
+  vi->unique_vert_len = uniq_verts;
 
   vi->vert_indices = vert_indices;
   vi->mverts = verts;
diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
index c4f436ab280..eb7ba5a7f33 100644
--- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc
@@ -245,13 +245,12 @@ static float automasking_view_occlusion_factor(AutomaskingCache *automasking,
                                                SculptSession *ss,
                                                PBVHVertRef vertex,
                                                uchar stroke_id,
-                                               AutomaskingNodeData * automask_data)
+                                               AutomaskingNodeData *automask_data)
 {
   char f = *(char *)SCULPT_vertex_attr_get(vertex, ss->attrs.automasking_occlusion);
 
   if (stroke_id != automasking->current_stroke_id) {
-    f = *(char *)SCULPT_vertex_attr_get(
-        vertex, ss->attrs.automasking_occlusion) =
+    f = *(char *)SCULPT_vertex_attr_get(vertex, ss->attrs.automasking_occlusion) =
         SCULPT_vertex_is_occluded(ss, vertex, automask_data->have_orig_data) ? 2 : 1;
   }
 
@@ -996,7 +995,7 @@ void SCULPT_automasking_cache_check(
       BKE_pbvh_vertex_iter_begin (ss->pbvh, node, vd, PBVH_ITER_ALL) {
         SCULPT_automasking_node_update(ss, &automask_data, &vd);
 
-        if (vd.i >= vd.unique_verts_count) {
+        if (vd.i >= vd.unique_vert_len) {
           node_other_verts[i].append(vd.vertex);
         }
         else {
diff --git a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
index ddb806690dd..c306906f5b1 100644
--- a/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
+++ b/source/blender/editors/sculpt_paint/sculpt_paint_image.cc
@@ -137,15 +137,9 @@ static float paint_automasking_interp(SculptSession *ss,
 
   BLI_assert(BKE_pbvh_type(ss->pbvh) == PBVH_FACES);
 
-#if 0
-  v1 = BKE_pbvh_index_to_vertex(ss->pbvh, triangle.vert_indices[0]);
-  v2 = BKE_pbvh_index_to_vertex(ss->pbvh, triangle.vert_indices[1]);
-  v3 = BKE_pbvh_index_to_vertex(ss->pbvh, triangle.vert_indices[2]);
-#else
   v1.i = triangle.vert_indices[0];
   v2.i = triangle.vert_indices[1];
   v3.i = triangle.vert_indices[2];
-#endif
 
   float a = SCULPT_automasking_factor_get(ss->cache->automasking, ss, v1, &automask_data);
   float b = SCULPT_automasking_factor_get(ss->cache->automasking, ss, v2, &automask_data);



More information about the Bf-blender-cvs mailing list