Page MenuHome

Geometry Nodes: Multi-thread selection creation from evaluated field
ClosedPublic

Authored by Hans Goudey (HooglyBoogly) on Mar 24 2022, 6:24 AM.

Details

Summary

When boolean fields are evaluated and used as selections, we create
a vector of indices. This process is currently single-threaded, but
226f0c4fef7e7792c added a more optimized multi-threaded version
of this process. It's simple to use this in the field evaluator.

I tested this with the set position node and a random
value node set to boolean mode on a Ryzen 2700x:

BeforeAfterImprovement
10% Selected40.5 ms29.0 ms1.4x
90% Selected115 ms45.3 ms2.5x

In the future there could be a specialized version for non-span
virtual array selections that uses materialize to lower virtual
call overhead.

Tests pass locally.

Diff Detail

Repository
rB Blender

Event Timeline

Hans Goudey (HooglyBoogly) requested review of this revision.Mar 24 2022, 6:24 AM
Hans Goudey (HooglyBoogly) created this revision.
Hans Goudey (HooglyBoogly) edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Mar 24 2022, 7:50 PM