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

◆ on_descriptors_created()

void MayaFlux::Buffers::VertexFieldProcessor::on_descriptors_created ( )
overrideprotectedvirtual

Write the cluster_id descriptor when the operator needs one.

A no-op call when m_needs_cluster_id is false. hash_cluster_id's underlying allocation is fixed-size for the buffer's whole lifetime (NetworkGeometryBuffer::declare_state never resizes a declared state field the way the primary vertex buffer resizes), so a single write here each time descriptor sets are (re)created is sufficient; unlike NetworkStateFieldProcessor's own fields, nothing here needs rewriting every cycle for resize-safety.

Reimplemented from MayaFlux::Buffers::ShaderProcessor.

Definition at line 247 of file VertexFieldProcessor.cpp.

248{
250 return;
251 }
252
253 auto& foundry = Portal::Graphics::get_shader_foundry();
254 const auto handle = m_network_buffer->read_state_handle("hash_cluster_id");
255 const auto bytes = m_network_buffer->get_state_bytes("hash_cluster_id");
256
257 foundry.update_descriptor_buffer(
258 m_descriptor_set_ids[0], m_operator->get_vertex_binding() + 1,
259 vk::DescriptorType::eStorageBuffer, handle, 0, bytes);
260}
std::vector< Portal::Graphics::DescriptorSetID > m_descriptor_set_ids
std::shared_ptr< NetworkGeometryBuffer > m_network_buffer
std::shared_ptr< Nodes::Network::GpuFieldOperator > m_operator
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.

References MayaFlux::Portal::Graphics::get_shader_foundry(), MayaFlux::Buffers::ShaderProcessor::m_descriptor_set_ids, m_needs_cluster_id, m_network_buffer, and m_operator.

+ Here is the call graph for this function: