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

◆ sync_revision()

bool MayaFlux::Buffers::VertexFieldProcessor::sync_revision ( )
private

Recompile and rebuild the pipeline when the operator has changed.

Returns
False when the operator no longer yields a spec.

Definition at line 143 of file VertexFieldProcessor.cpp.

144{
145 if (m_operator->revision() == m_built_revision)
146 return true;
147
148 auto spec = m_operator->build_spec();
149 if (!spec.has_value()) {
151 "VertexFieldProcessor: operator no longer yields a spec after rebind. "
152 "Dispatch suppressed; the previous pipeline is not reused because it "
153 "no longer describes the bindings.");
154 m_built_revision = m_operator->revision();
155 return false;
156 }
157
158 set_config(ShaderConfig(*spec));
159
160 add_binding("vertices",
161 ShaderBinding(0, m_operator->get_vertex_binding(),
163
164 m_needs_cluster_id = m_operator->needs_cluster_id();
165 if (m_needs_cluster_id) {
166 add_binding("cluster_id",
167 ShaderBinding(0, m_operator->get_vertex_binding() + 1,
169 }
170
171 m_params.stride_words = m_operator->get_layout().stride_bytes / 4;
172 m_built_revision = m_operator->revision();
173
175 "VertexFieldProcessor: rebuilt for revision {} ({} bound fields)",
176 m_built_revision, m_operator->binding_count());
177
178 return ensure_cluster_binding();
179}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
void add_binding(const std::string &descriptor_name, const ShaderBinding &binding)
Add descriptor binding configuration.
void set_config(const ShaderConfig &config)
Update entire configuration.
bool ensure_cluster_binding()
Ensure the backing hash_cluster_id state field exists, when m_needs_cluster_id is true.
std::shared_ptr< Nodes::Network::GpuFieldOperator > m_operator
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.
@ STORAGE
Large arrays or buffers the shader may write (SSBO)

References MayaFlux::Buffers::ShaderProcessor::add_binding(), MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, ensure_cluster_binding(), m_built_revision, m_needs_cluster_id, m_operator, m_params, MF_ERROR, MF_INFO, MayaFlux::Buffers::ShaderProcessor::set_config(), MayaFlux::Portal::Graphics::STORAGE, and MayaFlux::Buffers::VertexFieldProcessor::RangeParams::stride_words.

Referenced by on_before_execute().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: