diff options
author | Hans Goudey <h.goudey@me.com> | 2022-02-10 19:58:35 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-02-10 19:59:20 +0300 |
commit | 7682d7de046185382985999f8f6b6e7dcf860582 (patch) | |
tree | 6fae3aeb24d1d1a5d40e40bc489d8498566583fb /source/blender/editors/sculpt_paint/sculpt.c | |
parent | 2cd1472f86dd0c3f8792f8d28b1238f9dffb3739 (diff) |
Refactor: Move PBVH update tag out of MVert
This is part of the project of converting `MVert` into `float3`.
(more details in T93602), The pbvh update flag is removed and
replaced with a bitmap stored in the PBVH structure. This
patch is similar to D13878. This is mainly setup for an eventual
performance improvement by removing the extra data from
mesh vertices, but if it's consistent with testing in the other patch
doing the same thing for another "temp tag", then it may actually
increase the speed of sculpt code slightly, since less memory needs
to be loaded when checking/changing the flags.
Differential Revision: https://developer.blender.org/D14000
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/sculpt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index ea3d694542c..5faf9271848 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -349,7 +349,7 @@ void SCULPT_vertex_visible_set(SculptSession *ss, int index, bool visible) switch (BKE_pbvh_type(ss->pbvh)) { case PBVH_FACES: SET_FLAG_FROM_TEST(ss->mvert[index].flag, !visible, ME_HIDE); - ss->mvert[index].flag |= ME_VERT_PBVH_UPDATE; + BKE_pbvh_vert_mark_update(ss->pbvh, index); break; case PBVH_BMESH: BM_elem_flag_set(BM_vert_at_index(ss->bm, index), BM_ELEM_HIDDEN, !visible); @@ -592,7 +592,7 @@ static void UNUSED_FUNCTION(sculpt_visibility_sync_vertex_to_face_sets)(SculptSe ss->face_sets[vert_map->indices[i]] = -abs(ss->face_sets[vert_map->indices[i]]); } } - ss->mvert[index].flag |= ME_VERT_PBVH_UPDATE; + BKE_pbvh_vert_mark_update(ss->pbvh, index); } void SCULPT_visibility_sync_all_vertex_to_face_sets(SculptSession *ss) @@ -1398,7 +1398,7 @@ static void paint_mesh_restore_co_task_cb(void *__restrict userdata, } if (vd.mvert) { - vd.mvert->flag |= ME_VERT_PBVH_UPDATE; + BKE_pbvh_vert_mark_update(ss->pbvh, vd.index); } } BKE_pbvh_vertex_iter_end; @@ -2988,7 +2988,7 @@ static void do_gravity_task_cb_ex(void *__restrict userdata, mul_v3_v3fl(proxy[vd.i], offset, fade); if (vd.mvert) { - vd.mvert->flag |= ME_VERT_PBVH_UPDATE; + BKE_pbvh_vert_mark_update(ss->pbvh, vd.index); } } BKE_pbvh_vertex_iter_end; |