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

◆ bind_descriptor() [1/2]

void MayaFlux::Buffers::FormaBindingsProcessor::bind_descriptor ( const std::string &  name,
std::function< float()>  reader,
const std::string &  descriptor_name,
uint32_t  binding_index,
uint32_t  set,
Portal::Graphics::DescriptorRole  role = Portal::Graphics::DescriptorRole::UNIFORM 
)

Bind a type-erased reader to a descriptor binding.

Used by Bridge for the same reason as the push constant raw overload.

Parameters
nameLogical binding name.
readerCallable returning the current float value each tick.
descriptor_nameDescriptor name in the shader config.
binding_indexVulkan binding index within the descriptor set.
setDescriptor set index.
roleUNIFORM for UBO, STORAGE for SSBO.

Definition at line 94 of file FormaBindingsProcessor.cpp.

101{
102 if (!reader) {
104 "FormaBindingsProcessor::bind_descriptor: null reader for '{}'", name);
105 return;
106 }
107
108 release(name);
109 auto& b = m_bindings[name];
111 b.reader = std::move(reader);
112 b.typed_reader = nullptr;
113 b.pc.reset();
114
115 auto gpu_buf = make_descriptor_buffer(role);
116
117 b.desc = DescriptorTarget {
118 .descriptor_name = descriptor_name,
119 .set_index = set,
120 .binding_index = binding_index,
121 .role = role,
122 .gpu_buffer = gpu_buf,
123 .buffer_size = sizeof(float),
124 };
125
126 bind_buffer(descriptor_name, gpu_buf);
128}
#define MF_ERROR(comp, ctx,...)
size_t b
std::string name
Definition VKDevice.cpp:123
static std::shared_ptr< VKBuffer > make_descriptor_buffer(Portal::Graphics::DescriptorRole role)
std::unordered_map< std::string, Binding > m_bindings
void bind_buffer(const std::string &descriptor_name, const std::shared_ptr< VKBuffer > &buffer)
Bind a VKBuffer to a named shader descriptor.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References b, MayaFlux::Buffers::ShaderProcessor::bind_buffer(), MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, DESCRIPTOR, MayaFlux::Buffers::FormaBindingsProcessor::DescriptorTarget::descriptor_name, m_bindings, MayaFlux::Buffers::ShaderProcessor::m_needs_descriptor_rebuild, make_descriptor_buffer(), MF_ERROR, name, and release().

+ Here is the call graph for this function: