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

◆ bind_push_constant() [1/2]

void MayaFlux::Buffers::FormaBindingsProcessor::bind_push_constant ( const std::string &  name,
std::function< float()>  reader,
uint32_t  offset,
size_t  size = sizeof(float) 
)

Bind a type-erased reader to a push constant slot.

Used by Bridge, which holds readers as std::function<float()> after type-erasing MappedState<T> at register_element time.

Parameters
nameLogical binding name.
readerCallable returning the current float value each tick.
offsetByte offset in the push constant struct.
sizeByte width. Defaults to sizeof(float).

Definition at line 25 of file FormaBindingsProcessor.cpp.

30{
31 auto& b = m_bindings[name];
33 b.reader = std::move(reader);
34 b.pc = PushConstantTarget { .offset = offset, .size = size };
35 b.desc.reset();
36}
size_t b
std::unordered_map< std::string, Binding > m_bindings

References b, m_bindings, MayaFlux::Buffers::FormaBindingsProcessor::PushConstantTarget::offset, and PUSH_CONSTANT.