Mesh: Use attribute API in merge by distance code

Split the result mesh generation to work into two loops. The first loop
builds topology maps used for propagating attribute values, and the next
loop mixes attribute values with those maps. This has a few benefits:
The propagation can be done in parallel, and the topology mapping code
can get simpler. Also, we reduce the overhead that comes with iterating
over all attributes for every single element. Overall I didn't measure
a large performance difference though, because the new code has the
downside of needing to allocate two more arrays.

There is a small difference of a propagated byte color (250 vs. 251) in
the geometry nodes test due to a subtle difference in the mixing
implementation.

Part of #122398.

Pull Request: https://projects.blender.org/blender/blender/pulls/147367
This commit is contained in:
Hans Goudey
2025-10-08 16:37:07 +02:00
committed by Hans Goudey
parent a3f4f832cc
commit 3a82ac0a33
2 changed files with 284 additions and 153 deletions

Binary file not shown.