ebe8f8ce719729eef402119f4d0edd29e746abf3
Currently this conversion (which happens when using modifiers in edit mode, for example) is completely single threaded. It's harder than some other areas to multithread because BMesh elements don't always know their indices (and vise versa), and because the dynamic AoS format used by BMesh makes some typical solutions not helpful. This patch proposes to split the operation into two steps. The first updates the indices of BMesh elements and builds tables for easy iteration later. It also checks if some optional mesh attributes should be added. The second uses parallel loops over all elements, copying attribute values and building the Mesh topology. Both steps process different domains in separate threads (though the first has to combine faces and loops). Though this isn't proper data parallelism, it's quite helpful because each domain doesn't affect the others. **Timings** I tested this on a Ryzen 7950x with a 1 million face grid, with no extra attributes and then with several color attributes and vertex groups. | File | Before | After | | Simple | 101.6 ms | 59.6 ms | | More Attributes | 149.2 ms | 65.6 ms | The optimization scales better with more attributes on the BMesh. The speedup isn't as linear as multithreading other operations, indicating added overhead. I think this is worth it though, because the user is usually actively interacting with a mesh in edit mode. See the differential revision for more timing information. Differential Revision: https://developer.blender.org/D16249
…
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%
