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

◆ on_attach()

void MayaFlux::Buffers::RelaxationEmitProcessor::on_attach ( const std::shared_ptr< Buffer > &  buffer)
overrideprotectedvirtual

When attached to a RelaxationGridBuffer, sets up the dispatch configuration to cover the entire grid with a single workgroup dimension along Y and Z, and a workgroup size along X that is either the default 16 or the value supplied at construction.

Parameters
bufferThe attached buffer, expected to be a RelaxationGridBuffer.

Reimplemented from MayaFlux::Buffers::BufferProcessor.

Definition at line 20 of file RelaxationEmitProcessor.cpp.

21{
23 auto grid = std::dynamic_pointer_cast<RelaxationGridBuffer>(buffer);
24 if (grid) {
25 m_grid = grid;
26 constexpr uint32_t k_workgroup_size = 256;
27 set_workgroup_size(k_workgroup_size, 1, 1);
30 (grid->get_cell_count() + k_workgroup_size - 1) / k_workgroup_size,
31 1, 1);
33 }
34}
virtual void on_attach(const std::shared_ptr< Buffer > &)
Called when this processor is attached to a buffer.
void set_workgroup_size(uint32_t x, uint32_t y=1, uint32_t z=1)
Set workgroup size (should match shader local_size)
void set_dispatch_mode(ShaderDispatchConfig::DispatchMode mode)
Set dispatch mode.
void set_manual_dispatch(uint32_t x, uint32_t y=1, uint32_t z=1)
Set manual dispatch group counts.
void write_emit_constants()
Size the push constant block to EmitParams and upload the current parameters.
std::shared_ptr< RelaxationGridBuffer > m_grid

References m_grid, MayaFlux::Buffers::ShaderDispatchConfig::MANUAL, MayaFlux::Buffers::BufferProcessor::on_attach(), MayaFlux::Buffers::ComputeProcessor::set_dispatch_mode(), MayaFlux::Buffers::ComputeProcessor::set_manual_dispatch(), MayaFlux::Buffers::ComputeProcessor::set_workgroup_size(), and write_emit_constants().

+ Here is the call graph for this function: