52bf292349a58a84733a57dec89fe963b85b6d14
In order to make per-BVH-node overhead smaller and also to improve type safety and code clarity, split the `pbvh::Node` struct into four classes: a base class, and a class for each sculpt geometry type. The size of a mesh BVH node changes from 408 to 176 bytes. For multires the nodes are smaller at 96 bytes. This gives us leeway to make nodes smaller to benefit more from spacial locality, etc. It also just reduces memory usage. Using a `std::variant` makes the change quite simple actually. For the few places that actually need to process the node types separately given their different types, we use `std::visit`. Elsewhere we use `IndexMask` to retrieve selections of nodes from the vector instead, though most code will be refactored to that pattern separately. The new function `search_nodes` is the equivalent of the existing `gather_nodes` that returns an `IndexMask` instead of a vector of node pointers. Part of #118145. Pull Request: https://projects.blender.org/blender/blender/pulls/126873
…
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%
