d601bf7e3ddebf7c370bf023d13eb2d772dd973a
This commit rewrites the PBVH drawing using many of the principles from the ongoing sculpt refactor. First of all, per BVH node overhead is minimized. Previously the main entry point to the drawing API was per node, so there was significant overhead fetching global data and maintaining caches on a per-node basis. Now all of that "global" work happens for the entire geometry. We also now avoid creating wireframe index buffers and batches unless the viewport actually requests wireframe data. This was theoretically possible before, but the whole logic flow was so convoluted that the optimization was too difficult. Similarly, multithreading is used more consistently now. Because of OpenGL, flushing vertex/index buffers to the GPU has to happen on the main thread, but everything else can be multithreaded. With outer loops processing all relevant PBVH nodes, it's now trivial to apply multithreading wherever possible. Testing performance, overall this commit results in a 10% improvement in the time between opening a file with a large mesh sculpt and the first possible interaction. Specifically I measured a change from 8.4 to 7.6 seconds on a completely visible 16 million vertex mesh with a Ryzen 7950x. I also measured a decrease in memory usage from 4.79 to 4.31 GB. For multires I observed a similar improvement in memory usage, though less of a performance improvement. There are still significant opportunities for future improvement. #122775 would be particularly helpful. #99983 would be helpful too, though more complicated, and #97665 describes the problems a bit more generally. Part of #118145. Pull Request: https://projects.blender.org/blender/blender/pulls/127002
…
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%
