|
MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
|
| void MayaFlux::Buffers::SpatialHashConfig::declare_fields | ( | const std::shared_ptr< NetworkGeometryBuffer > & | buffer | ) | const |
Declare the four state fields the hash build stages read and write, sized from this config.
| buffer | Buffer to declare on. Fields already present under these names are left untouched (NetworkGeometryBuffer::declare_state rejects the duplicate and logs, matching its own documented behaviour). |
Declares hash_cell_count/hash_cell_start/hash_cell_cursor at cell_count() elements each, and hash_particle_index at particle_count elements. Call once before attaching HashClearProcessor/ HashCountProcessor/HashScanProcessor/HashScatterProcessor to the buffer's chain. All four fields are single-slot: every stage fully overwrites the ones it owns each cycle rather than reading a previous cycle's value, so none of them need a second ping-pong slot.
Also declares hash_cluster_id, one uint32 per particle, at particle_count elements. Unlike the four fields above it is written by no dispatch at all: NetworkGeometryBuffer uploads it once, at wiring time, from PhysicsOperator::get_collections(), since cluster membership is fixed the moment a collection is added and never changes cycle to cycle. Declared here rather than by MutationConfig because it is consumed by any hash-based neighbour query, not only the claim protocol: HashDensityColorProcessor reads it too, and a caller can enable density colouring with no absorb_radius at all, in which case MutationConfig::declare_fields never runs. Every entry is 0 when the operator carries at most one collection, so every cluster-aware guard built on this field is a no-op for the ordinary single-population case.
Definition at line 84 of file SpatialHashProcessor.cpp.
References cell_count(), and particle_count.
Referenced by MayaFlux::Buffers::NetworkGeometryBuffer::wire_field_operators().
Here is the call graph for this function:
Here is the caller graph for this function: