f10965dcb89bcd09cd69ecb72f61ff005b8b3e99
Reduce overhead of copying attribute data into GPU buffers when the PBVH is active. The existing lambda with a FunctionRef callback had a significant overhead. While that was reduced by25917f0165already, even making the `foreach_faces` lambda into a template gave significant overhead compared to simpler loops. Instead, separate value conversion and iteration over visible triangles in a way that the compiler is able to optimize more easily. According to the GPU module, it's also better to use raw data access than `GPU_vertbuf_raw_step`, since the data format strides aren't meant to vary by platform, and the runtime stride can have a noticeable performance impact. Also avoid recalculating face normals, since they're already used to calculate vertex normals anyway (sinceac02f94caf). I tested the runtime of the initial data-upload after entering sculpt mode with a 16 million vertex mesh. Before, that took 1350 ms, after it took 680 ms, which is almost a 2x improvement. In my tests, the performance improvement was only observable for the initial data upload, theoretically it is a more general change though. It's possible that a similar optimization could be applied to multires or dynamic topology sculpting, but that can be looked at later too. Pull Request: https://projects.blender.org/blender/blender/pulls/110621
…
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%
