59d6eae1160a9db991e6ee7b186844a9f04367ce
Addresses #121240. Instead of allocating a new array and recalculating mesh triangulation every time the user enters sculpt mode, reuse the mesh's existing cache. Currently in order to avoid recalculating triangulation on every brush update (which would typically be necessary because the triangulation direction depends on vertex positions), add a mechanism to "freeze" the cache to skip recalculations until the user exits sculpt mode. That even avoids recalculation if vertex positions aren't affected. This is necessary because we can't use the cache in a dirty state; tagging the cache dirty frees the triangulation array. Removing the duplicate triangles array reduces memory usage by 384 MB in a 16 million vertex sculpt, and makes entering sculpt mode 125ms faster (tested on a Ryzen 7840u). In the long term, I hope we find a different solution that's a bit more transparent and hopefully more integrated with the caching system in general. In the meantime, this is a relatively safe low impact change that helps document the needs for such a system anyway. Pull Request: https://projects.blender.org/blender/blender/pulls/123638
…
Blender
Blender is the free and open source 3D creation suite. It supports the entirety of the 3D pipeline-modeling, rigging, animation, simulation, rendering, compositing, motion tracking and video editing.
Project Pages
Development
License
Blender as a whole is licensed under the GNU General Public License, Version 3. Individual files may have a different, but compatible license.
See blender.org/about/license for details.
Description
Languages
C++
78%
Python
14.9%
C
2.9%
GLSL
1.9%
CMake
1.2%
Other
0.9%
