MayaFlux 1.0.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

Cover the grid with a 2D dispatch and write GridExtent.

Parameters
bufferThe attached buffer, expected to be a RelaxationGridBuffer.

The local size is fixed at 16x16x1 and the group counts are ceil(width / 16) by ceil(height / 16). The workgroup_x constructor argument and ShaderSpec::workgroup_size are not consulted once attached to a grid.

Reimplemented from MayaFlux::Buffers::BufferProcessor.

Definition at line 91 of file RelaxationStepProcessor.cpp.

92{
94 m_grid = std::dynamic_pointer_cast<RelaxationGridBuffer>(buffer);
95
96 if (m_grid) {
97 set_workgroup_size(16, 16, 1);
99 uint32_t gx = (m_grid->get_grid_width() + 15) / 16;
100 uint32_t gy = (m_grid->get_grid_height() + 15) / 16;
101 set_manual_dispatch(gx, gy, 1);
103 }
104}
std::shared_ptr< NetworkGeometryBuffer > buffer
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 reads.
void write_grid_extent_constants()
Size the push constant block to at least GridExtent and write the attached grid's dimensions into its...

References buffer, 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: