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

◆ write_descriptors()

void MayaFlux::Portal::Graphics::PrimitiveMill::write_descriptors ( const std::shared_ptr< Buffers::VKBuffer > &  source)
private

Points the descriptor set at the current buffer set, on any change of source or ring slot.

Rewriting a shared set is safe here because resolve_pending() has already retired the only submission that reads it, and the draw takes the milled buffer as vertex input rather than through this set.

Definition at line 592 of file PrimitiveMill.cpp.

593{
594 if (m_descriptors_written && m_bound_source.lock() == source
596 return;
597 }
598
599 auto& foundry = get_shader_foundry();
600 const auto set = m_sets.front();
601
602 const auto bind = [&](uint32_t binding, const std::shared_ptr<VKBuffer>& buf) {
603 foundry.update_descriptor_buffer(
604 set, binding, vk::DescriptorType::eStorageBuffer,
605 buf->get_buffer(), 0, buf->get_size_bytes());
606 };
607
608 bind(0, source);
609 bind(1, m_run_buf);
610 bind(2, m_prefix_buf);
611 bind(3, m_outputs[m_output_slot]);
612
616}
size_t m_bound_slot
Ring slot the descriptor set currently points at, for invalidation.
std::weak_ptr< Buffers::VKBuffer > m_bound_source
Source the descriptor set currently points at, for invalidation.
std::shared_ptr< Buffers::VKBuffer > m_prefix_buf
std::shared_ptr< Buffers::VKBuffer > m_run_buf
std::vector< DescriptorSetID > m_sets
std::vector< std::shared_ptr< Buffers::VKBuffer > > m_outputs
Milled buffers rotated between dispatches, all at m_output_capacity.
Source source()
Begin a Source chain.
Definition Plot.hpp:128
MAYAFLUX_API ShaderFoundry & get_shader_foundry()
Get the global shader compiler instance.

References MayaFlux::Portal::Graphics::get_shader_foundry(), m_bound_slot, m_bound_source, m_descriptors_written, m_output_slot, m_outputs, m_prefix_buf, m_run_buf, and m_sets.

Referenced by mill().

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