MayaFlux 0.5.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 156 of file FormaBindingsProcessor.cpp.

160{
161 upload_to_gpu(&value, sizeof(float), desc.gpu_buffer, nullptr);
162
163 auto& bindings_list = attached->get_pipeline_context().descriptor_buffer_bindings;
164
165 for (auto& entry : bindings_list) {
166 if (entry.set == desc.set_index && entry.binding == desc.binding_index) {
167 entry.buffer_info.buffer = desc.gpu_buffer->get_buffer();
168 entry.buffer_info.offset = 0;
169 entry.buffer_info.range = sizeof(float);
170 return;
171 }
172 }
173
174 bindings_list.push_back({
175 .set = desc.set_index,
176 .binding = desc.binding_index,
177 .type = (desc.role == Portal::Graphics::DescriptorRole::UNIFORM)
178 ? vk::DescriptorType::eUniformBuffer
179 : vk::DescriptorType::eStorageBuffer,
180 .buffer_info = vk::DescriptorBufferInfo {
181 desc.gpu_buffer->get_buffer(), 0, sizeof(float) },
182 });
183}
float value
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, MayaFlux::Buffers::upload_to_gpu(), and value.

Referenced by execute_shader().

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