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

◆ write() [1/16]

void MayaFlux::Portal::Forma::Bridge::write ( const ElementRef &  ref,
const std::shared_ptr< Buffers::VKBuffer > &  target_buffer,
const std::string &  shader_path,
const std::string &  descriptor_name,
uint32_t  binding_index,
uint32_t  set,
Portal::Graphics::DescriptorRole  role = Portal::Graphics::DescriptorRole::UNIFORM 
)

Route element value to a descriptor binding on target_buffer.

Creates a FormaBindingsProcessor if one does not yet exist for this element and attaches it to target_buffer. If a processor already exists from a prior write() call, target_buffer must be the same buffer — a second attachment is not made.

Parameters
refOwning Layer and element id.
target_bufferBuffer whose pipeline context receives the descriptor update.
shader_pathShader path used to construct FormaBindingsProcessor if needed.
descriptor_nameDescriptor name in the shader config.
binding_indexVulkan binding index.
setDescriptor set index.
roleUNIFORM or STORAGE.

Definition at line 156 of file Bridge.cpp.

164{
165 auto* rec = find_record(ref);
166 if (!rec) {
168 "Bridge::write: unknown element id {}", ref.second);
169 return;
170 }
171
172 if (!rec->bindings) {
173 rec->bindings = std::make_shared<Buffers::FormaBindingsProcessor>(shader_path);
174 m_buffer_manager.add_processor(rec->bindings, target_buffer,
176 }
177
178 auto binding_name = descriptor_name + "_" + std::to_string(ref.second);
179 rec->bindings->bind_descriptor(binding_name, rec->reader, descriptor_name, binding_index, set, role);
180 rec->binding_names.push_back(std::move(binding_name));
181}
#define MF_ERROR(comp, ctx,...)
void add_processor(const std::shared_ptr< BufferProcessor > &processor, const std::shared_ptr< Buffer > &buffer, ProcessingToken token=ProcessingToken::AUDIO_BACKEND)
Adds a processor to a buffer.
Buffers::BufferManager & m_buffer_manager
Definition Bridge.hpp:694
ElementRecord * find_record(const ElementRef &ref)
Definition Bridge.cpp:406
@ GRAPHICS_BACKEND
Standard graphics processing backend configuration.
@ Init
Engine/subsystem initialization.
@ Portal
High-level user-facing API layer.

References MayaFlux::Buffers::BufferManager::add_processor(), find_record(), MayaFlux::Buffers::GRAPHICS_BACKEND, MayaFlux::Journal::Init, m_buffer_manager, MF_ERROR, and MayaFlux::Journal::Portal.

+ Here is the call graph for this function: