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

◆ write() [8/12]

void MayaFlux::Portal::Forma::Bridge::write ( uint32_t  id,
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
idElement 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 96 of file Bridge.cpp.

102{
103 auto it = m_records.find(id);
104 if (it == m_records.end())
105 return;
106
107 auto& rec = it->second;
108 if (!rec.bindings) {
109 rec.bindings = std::make_shared<Buffers::FormaBindingsProcessor>(shader_path);
110 m_buffer_manager.add_processor(rec.bindings, target_buffer,
112 }
113
114 rec.bindings->bind_push_constant(
115 std::to_string(id) + "_pc_" + std::to_string(offset),
116 rec.reader,
117 offset, size);
118}
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.
std::unordered_map< uint32_t, ElementRecord > m_records
Definition Bridge.hpp:527
Buffers::BufferManager & m_buffer_manager
Definition Bridge.hpp:523
@ GRAPHICS_BACKEND
Standard graphics processing backend configuration.

References MayaFlux::Buffers::BufferManager::add_processor(), MayaFlux::Buffers::GRAPHICS_BACKEND, m_buffer_manager, and m_records.

+ Here is the call graph for this function: