diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-19 07:48:43 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-19 07:48:43 +0300 |
commit | 8c25889bb67db4c1d2f94bf85ca6d1c2a050fcfe (patch) | |
tree | 772697b82ecd172e577ef11779543c523b4e86f8 /source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc | |
parent | 775f0d76d55b2977c30dcd0f9306437ae520d63f (diff) |
Refactor: Move mesh face dot tag out of MVert
Continuing the refactors described in T93602, this commit moves
the face dot tag set by the subdivision surface modifier out of
`MVert` to `MeshRuntime`. This clarifies its status as runtime data
and allows further refactoring of mesh positions in the future.
Before, `BKE_modifiers_uses_subsurf_facedots` was used to check
whether subsurf face dots should be drawn, but now we can just check
if the tags exist on the mesh. Modifiers that create new new geometry
or modify topology will already remove the array by clearing mesh
runtime data.
Differential Revision: https://developer.blender.org/D14680
Diffstat (limited to 'source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc')
-rw-r--r-- | source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc index 7a3c108b75a..26f0b07f676 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_fdots_uv.cc @@ -5,6 +5,8 @@ * \ingroup draw */ +#include "BLI_bitmap.h" + #include "extract_mesh.h" namespace blender::draw { @@ -72,13 +74,14 @@ static void extract_fdots_uv_iter_poly_mesh(const MeshRenderData *mr, void *_data) { MeshExtract_FdotUV_Data *data = static_cast<MeshExtract_FdotUV_Data *>(_data); + const BLI_bitmap *facedot_tags = mr->me->runtime.subsurf_face_dot_tags; + const MLoop *mloop = mr->mloop; const int ml_index_end = mp->loopstart + mp->totloop; for (int ml_index = mp->loopstart; ml_index < ml_index_end; ml_index += 1) { const MLoop *ml = &mloop[ml_index]; if (mr->use_subsurf_fdots) { - const MVert *mv = &mr->mvert[ml->v]; - if (mv->flag & ME_VERT_FACEDOT) { + if (BLI_BITMAP_TEST(facedot_tags, ml->v)) { copy_v2_v2(data->vbo_data[mp_index], data->uv_data[ml_index].uv); } } |