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

◆ ensure_buffer_capacity()

void MayaFlux::Buffers::DescriptorBindingsProcessor::ensure_buffer_capacity ( DescriptorBinding binding,
size_t  required_size 
)
private

Ensure descriptor buffer has sufficient capacity.

Parameters
bindingDescriptor binding to check
required_sizeMinimum required size in bytes

If buffer is too small, resizes with 50% over-allocation. Sets m_needs_descriptor_rebuild flag if resize occurs.

Definition at line 313 of file DescriptorBindingsProcessor.cpp.

316{
317 if (required_size <= binding.gpu_buffer->get_size_bytes()) {
318 return;
319 }
320
321 size_t new_size = required_size * 3 / 2;
322
324 "Resizing descriptor buffer '{}': {} → {} bytes",
325 binding.descriptor_name, binding.buffer_size, new_size);
326
327 binding.gpu_buffer->resize(new_size, false);
328
329 binding.buffer_size = new_size;
330
332}
#define MF_DEBUG(comp, ctx,...)
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Buffers::DescriptorBindingsProcessor::DescriptorBinding::buffer_size, MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Buffers::DescriptorBindingsProcessor::DescriptorBinding::descriptor_name, MayaFlux::Buffers::DescriptorBindingsProcessor::DescriptorBinding::gpu_buffer, MayaFlux::Buffers::ShaderProcessor::m_needs_descriptor_rebuild, and MF_DEBUG.

Referenced by update_descriptor_from_node().

+ Here is the caller graph for this function: