MayaFlux 0.5.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 127 of file VertexFieldProcessor.cpp.

128{
129 if (m_operator->revision() == m_built_revision)
130 return true;
131
132 auto spec = m_operator->build_spec();
133 if (!spec.has_value()) {
135 "VertexFieldProcessor: operator no longer yields a spec after rebind. "
136 "Dispatch suppressed; the previous pipeline is not reused because it "
137 "no longer describes the bindings.");
138 m_built_revision = m_operator->revision();
139 return false;
140 }
141
142 set_config(ShaderConfig(*spec));
143
144 add_binding("vertices",
145 ShaderBinding(0, m_operator->get_vertex_binding(),
147
148 m_needs_cluster_id = m_operator->needs_cluster_id();
149 if (m_needs_cluster_id) {
150 add_binding("cluster_id",
151 ShaderBinding(0, m_operator->get_vertex_binding() + 1,
153 }
154
155 m_params.stride_words = m_operator->get_layout().stride_bytes / 4;
156 m_built_revision = m_operator->revision();
157
159 "VertexFieldProcessor: rebuilt for revision {} ({} bound fields)",
160 m_built_revision, m_operator->binding_count());
161
162 return ensure_cluster_binding();
163}
#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: