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

◆ on_before_execute()

bool MayaFlux::Buffers::VertexFieldProcessor::on_before_execute ( Portal::Graphics::CommandBufferID  cmd_id,
const std::shared_ptr< VKBuffer > &  buffer 
)
overrideprotectedvirtual

Rebuild on a stale revision, resolve the range, write push constants.

Returns
False to suppress the dispatch when the range is empty or the operator no longer produces a spec.

Reimplemented from MayaFlux::Buffers::ShaderProcessor.

Definition at line 165 of file VertexFieldProcessor.cpp.

168{
169 if (!buffer)
170 return false;
171
172 if (!sync_revision())
173 return false;
174
175 const uint32_t capacity = buffer_capacity(buffer);
176 if (capacity == 0)
177 return false;
178
179 if (m_range_set) {
180 if (m_explicit_first >= capacity) {
182 "VertexFieldProcessor: range starts at {} but the buffer holds {} "
183 "records. Dispatch suppressed.",
184 m_explicit_first, capacity);
185 return false;
186 }
187
190 } else {
192 m_params.vertex_count = capacity;
193 }
194
195 if (m_params.vertex_count == 0)
196 return false;
197
199
201 "VertexFieldProcessor dispatch: [{}, {}) of {} records, stride {} words, t={:.3f}",
204 capacity,
206 m_params.time);
207
209 return true;
210}
#define MF_RT_ERROR(comp, ctx,...)
#define MF_RT_TRACE(comp, ctx,...)
void set_push_constant_data(const T &data)
Update push constant data (type-safe)
uint32_t buffer_capacity(const std::shared_ptr< VKBuffer > &buffer) const
Records the buffer can hold at the operator's stride.
bool sync_revision()
Recompile and rebuild the pipeline when the operator has changed.
float elapsed() const
Seconds since construction, the value bound to the time parameter.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References buffer_capacity(), MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, elapsed(), MayaFlux::Buffers::VertexFieldProcessor::RangeParams::first_vertex, m_explicit_count, m_explicit_first, m_params, m_range_set, MF_RT_ERROR, MF_RT_TRACE, MayaFlux::Buffers::ShaderProcessor::set_push_constant_data(), MayaFlux::Buffers::VertexFieldProcessor::RangeParams::stride_words, sync_revision(), MayaFlux::Buffers::VertexFieldProcessor::RangeParams::time, and MayaFlux::Buffers::VertexFieldProcessor::RangeParams::vertex_count.

+ Here is the call graph for this function: