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

◆ on_attach()

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

Cache and validate the volume, size the dispatch, write the shared parameter prefix, then call on_volume_ready.

Parameters
bufferThe attached buffer, expected to be a VolumeGridBuffer.

On any validation failure the cached volume is reset, which makes on_before_execute reject every subsequent cycle.

Reimplemented from MayaFlux::Buffers::ShaderProcessor.

Definition at line 115 of file VolumeFieldProcessor.cpp.

116{
118
119 m_volume = std::dynamic_pointer_cast<VolumeGridBuffer>(buffer);
120 if (!m_volume) {
121 return;
122 }
123
124 if (!validate_fields()) {
125 m_volume.reset();
126 return;
127 }
128
130 reserve_param_size(k_prefix_size);
132
134}
virtual void on_attach(const std::shared_ptr< Buffer > &)
Called when this processor is attached to a buffer.
bool validate_fields()
Check every named field exists and that read-write fields carry two slots.
void reserve_param_size(size_t size)
Raise the push constant block to at least this size.
void size_dispatch()
Size the manual dispatch to cover the lattice.
std::shared_ptr< VolumeGridBuffer > m_volume
The attached volume, null until on_attach validates it.
virtual void on_volume_ready()
Hook for subclass parameters, called at the end of on_attach.
void write_lattice_params()
Write the lattice dimensions and cell size into the staged push constant block, preserving word three...

References m_volume, MayaFlux::Buffers::BufferProcessor::on_attach(), on_volume_ready(), reserve_param_size(), size_dispatch(), validate_fields(), and write_lattice_params().

+ Here is the call graph for this function: