diff options
author | Hans Goudey <h.goudey@me.com> | 2022-09-12 20:48:35 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-09-12 20:48:42 +0300 |
commit | b5f7af31d6d474c3b455bacda079969fde7c0962 (patch) | |
tree | f75a543982b38f5222052b80647fbf35f23b5805 /source/blender/blenkernel/intern/pbvh_intern.h | |
parent | 3d3c34f345c766daabb56a453f8c8ef7bead801b (diff) |
When these features aren't used, there is no sense in storing the
corresponding data layers and using their values for computations.
Avoiding that should increase performance in many operations that
would otherwise have to read, write, or propagate these values.
It also means decreased memory usage-- not just for sculpt mode
but for any mesh that was in sculpt mode. Previously the mask, face set,
and hide status layers were *always* allocated by sculpt mode.
Here are a few basic tests when masking and face sets are not used:
| Test | Before | After |
| Subsurf Modifier | 148 ms | 126 ms |
| Sculpt Overlay Extraction | 24 ms every redraw | 0 ms |
| Memory usage | 252 MB | 236 MB |
I wouldn't expect any difference when they are used though.
The code changes are mostly just making sculpt features safe for when
the layers aren't stored, and some changes to the conversion to and
from the hide layers. Use of the ".hide_poly" attribute replaces testing
whether face sets are negative in many places.
Differential Revision: https://developer.blender.org/D15937
Diffstat (limited to 'source/blender/blenkernel/intern/pbvh_intern.h')
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_intern.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/pbvh_intern.h b/source/blender/blenkernel/intern/pbvh_intern.h index b848327b7a9..8ab56839f9c 100644 --- a/source/blender/blenkernel/intern/pbvh_intern.h +++ b/source/blender/blenkernel/intern/pbvh_intern.h @@ -156,6 +156,7 @@ struct PBVH { bool *hide_vert; struct MVert *verts; const struct MPoly *mpoly; + bool *hide_poly; /** Material indices. Only valid for polygon meshes. */ const int *material_indices; const struct MLoop *mloop; |