MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ ClaimAccumulateProcessor()

MayaFlux::Buffers::ClaimAccumulateProcessor::ClaimAccumulateProcessor ( const MutationConfig config,
Nodes::Network::PhysicsOperator physics_op,
uint32_t  live_count = 0,
const std::shared_ptr< Nodes::Network::GpuFieldOperator > &  particle_op = nullptr,
bool  transfer_on_claim = false 
)
Parameters
configGrid/particle parameters shared with the claim stages.
physics_opNon-owning; must outlive this processor. Receives claimed_by via sync_bonds_from_claims when claim_events is nonzero, clear_bonds() otherwise. May be null to disable the readback entirely (GPU claim/swallow still runs unaffected).
live_countNonzero enables population dynamics: binds mutation_alive and sets it to 0 for any particle absorbed this cycle (destroy-on-absorption), and the CPU-facing side of this processor is truncated to exactly this many entries, both on the claimed_by readback handed to physics_op and on the accreted_mass upload (padded with 0 beyond live_count). This is the one enforcement point for SpatialFieldConfig::reserve_fraction's decoupling: PhysicsOperator never learns config.hash.particle_count exceeds its own simulated particle count, regardless of how much reserve capacity the GPU has spawned into. Also binds vertices and zeros a destroyed particle's size, every cycle for as long as it stays dead: nothing else keeps it invisible against NetworkGeometryProcessor's own unconditional re-upload of PhysicsOperator's CPU-simulated (size-unaware) data each cycle. 0 (the default) disables all of this and matches today's behaviour exactly, using config.hash.particle_count throughout.
particle_opRequired (must be non-null) when live_count is nonzero: supplies the vertex layout's size attribute offset. Ignored when live_count is 0.
transfer_on_claimWhen true, binds hash_cluster_id and treats a claim whose root sits in a different cluster as a transfer, not a consumption: that absorbed vertex is neither counted into its root's swallow_count nor (when live_count is nonzero) destroyed, leaving ClaimTransferProcessor to relabel it. False (the default) emits exactly today's shader, no cluster binding, no branch.

Definition at line 383 of file MutationClaimProcessor.cpp.

390 claim_accumulate_bindings(live_count != 0, transfer_on_claim),
391 build_claim_accumulate_spec(live_count != 0, transfer_on_claim))
392 , m_params {
393 .particle_count = config.hash.particle_count,
394 .stride_words = config.hash.stride_words,
395 .size_offset = live_count != 0 ? require_color_and_size_offset(particle_op).second : 0U,
396 }
397 , m_physics_op(physics_op)
398 , m_live_count(live_count != 0 ? live_count : config.hash.particle_count)
399{
400}
NetworkStateFieldProcessor(std::vector< FieldBinding > bindings, const Portal::Graphics::ShaderSpec &spec)
Construct from a generated ShaderSpec.