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

◆ flush_descriptor()

void MayaFlux::Buffers::FormaBindingsProcessor::flush_descriptor ( float  value,
const DescriptorTarget desc,
const std::shared_ptr< VKBuffer > &  attached 
)
private

Definition at line 149 of file FormaBindingsProcessor.cpp.

153{
154 upload_to_gpu(&value, sizeof(float), desc.gpu_buffer, nullptr);
155
156 auto& bindings_list = attached->get_pipeline_context().descriptor_buffer_bindings;
157
158 for (auto& entry : bindings_list) {
159 if (entry.set == desc.set_index && entry.binding == desc.binding_index) {
160 entry.buffer_info.buffer = desc.gpu_buffer->get_buffer();
161 entry.buffer_info.offset = 0;
162 entry.buffer_info.range = sizeof(float);
163 return;
164 }
165 }
166
167 bindings_list.push_back({
168 .set = desc.set_index,
169 .binding = desc.binding_index,
170 .type = (desc.role == Portal::Graphics::DescriptorRole::UNIFORM)
171 ? vk::DescriptorType::eUniformBuffer
172 : vk::DescriptorType::eStorageBuffer,
173 .buffer_info = vk::DescriptorBufferInfo {
174 desc.gpu_buffer->get_buffer(), 0, sizeof(float) },
175 });
176}
void upload_to_gpu(const void *data, size_t size, const std::shared_ptr< VKBuffer > &target, const std::shared_ptr< VKBuffer > &staging)
Upload raw data to GPU buffer (auto-detects host-visible vs device-local)
@ UNIFORM
Small, read-only, frequently updated (scalars, param structs)

References MayaFlux::Buffers::FormaBindingsProcessor::DescriptorTarget::binding_index, MayaFlux::Buffers::FormaBindingsProcessor::DescriptorTarget::gpu_buffer, MayaFlux::Buffers::FormaBindingsProcessor::DescriptorTarget::role, MayaFlux::Buffers::FormaBindingsProcessor::DescriptorTarget::set_index, MayaFlux::Portal::Graphics::UNIFORM, and MayaFlux::Buffers::upload_to_gpu().

Referenced by execute_shader().

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