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

◆ stage_descriptor()

void MayaFlux::Buffers::RaymarchProcessor::stage_descriptor ( const std::shared_ptr< VKBuffer > &  buffer,
vk::Buffer  handle 
)
private

Insert or replace the descriptor entry for the field handle.

Parameters
bufferBuffer whose pipeline context is staged onto.
handleHandle resolved this cycle.

Definition at line 111 of file RaymarchProcessor.cpp.

113{
114 auto& bindings = buffer->get_pipeline_context().descriptor_buffer_bindings;
115
116 auto it = std::ranges::find_if(bindings, [this](const auto& entry) {
117 return entry.set == m_set && entry.binding == m_binding;
118 });
119
120 if (it == bindings.end()) {
121 bindings.push_back(Portal::Graphics::DescriptorBindingInfo {
122 .set = m_set,
123 .binding = m_binding,
124 .type = vk::DescriptorType::eStorageBuffer,
125 .buffer_info = vk::DescriptorBufferInfo(handle, 0, m_field_bytes),
126 .name = k_binding_name,
127 .count = 1,
128 });
129 return;
130 }
131
132 it->buffer_info.buffer = handle;
133 it->buffer_info.offset = 0;
134 it->buffer_info.range = m_field_bytes;
135}

References m_binding, m_field_bytes, m_set, and MayaFlux::Portal::Graphics::DescriptorBindingInfo::set.

Referenced by on_attach(), and processing_function().

+ Here is the caller graph for this function: