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

◆ write() [3/16]

void MayaFlux::Portal::Forma::Bridge::write ( const ElementRef &  ref,
const std::shared_ptr< Buffers::VKBuffer > &  target_buffer,
const std::string &  shader_path,
uint32_t  offset,
size_t  size = sizeof(float) 
)

Route element value to a push constant slot on a ShaderProcessor.

Parameters
refOwning Layer and element id.
targetVKBuffer whose push_constant staging receives the value.
offsetByte offset in the push constant struct.
sizeByte width. Defaults to sizeof(float).

Definition at line 102 of file Bridge.cpp.

108{
109 auto* rec = find_record(ref);
110 if (!rec) {
112 "Bridge::write: unknown element id {}", ref.second);
113 return;
114 }
115
116 if (!rec->bindings) {
117 rec->bindings = std::make_shared<Buffers::FormaBindingsProcessor>(shader_path);
118 m_buffer_manager.add_processor(rec->bindings, target_buffer,
120 }
121
122 auto binding_name = std::to_string(ref.second) + "_pc_" + std::to_string(offset);
123 rec->bindings->bind_push_constant(binding_name, rec->reader, offset, size);
124 rec->binding_names.push_back(std::move(binding_name));
125}
#define MF_ERROR(comp, ctx,...)
uint64_t offset
Definition Composite.cpp:10
bool size
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, offset, MayaFlux::Journal::Portal, and size.

+ Here is the call graph for this function: