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

◆ on_attach()

void MayaFlux::Buffers::RelaxationStepProcessor::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 76 of file RelaxationStepProcessor.cpp.

77{
79 m_grid = std::dynamic_pointer_cast<RelaxationGridBuffer>(buffer);
80
81 if (m_grid) {
82 set_workgroup_size(16, 16, 1);
84 uint32_t gx = (m_grid->get_grid_width() + 15) / 16;
85 uint32_t gy = (m_grid->get_grid_height() + 15) / 16;
86 set_manual_dispatch(gx, gy, 1);
88 }
89}
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.
std::shared_ptr< RelaxationGridBuffer > m_grid
The attached RelaxationGridBuffer, cached for descriptor writes and snapshot staging.
void write_grid_extent_constants()
Size the push constant block to at least GridExtent and write the attached grid's dimensions into its...

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_grid_extent_constants().

+ Here is the call graph for this function: