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

◆ bind_push_constant() [2/4]

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 if (!reader) {
33 "FormaBindingsProcessor::bind_push_constant: null reader for '{}'", name);
34 return;
35 }
36
38 auto& b = m_bindings[name];
40 b.reader = std::move(reader);
41 b.typed_reader = nullptr;
42 b.pc = PushConstantTarget { .offset = offset, .size = size };
43 b.desc.reset();
44}
#define MF_ERROR(comp, ctx,...)
uint64_t offset
Definition Composite.cpp:10
bool size
size_t b
std::string name
Definition VKDevice.cpp:123
std::unordered_map< std::string, Binding > m_bindings
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References b, MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, m_bindings, MF_ERROR, name, MayaFlux::Buffers::FormaBindingsProcessor::PushConstantTarget::offset, offset, PUSH_CONSTANT, release(), and size.

+ Here is the call graph for this function: