9 const std::string& name,
10 const std::shared_ptr<Nodes::Node>& node,
29 std::vector<std::string> names;
32 names.push_back(name);
41 auto& staging = buffer->get_pipeline_context().push_constant_staging;
43 for (
const auto& [name, binding] :
m_bindings) {
44 size_t end_offset = binding.push_constant_offset + binding.size;
46 if (staging.size() < end_offset) {
47 staging.resize(end_offset);
51 staging.data() + binding.push_constant_offset,
56 "NodeBindingsProcessor: Merged binding '{}' at offset {} ({} bytes)",
57 name, binding.push_constant_offset, binding.size);
65 "No node bindings configured for NodeBindingsProcessor");
72 size_t required_size = binding.push_constant_offset + binding.size;
73 if (pc_data.size() < required_size) {
74 pc_data.resize(required_size);
79 "Node binding '{}' has null node", name);
85 if (binding.size ==
sizeof(
float)) {
86 auto float_val =
static_cast<float>(value);
88 pc_data.data() + binding.push_constant_offset,
91 }
else if (binding.size ==
sizeof(
double)) {
93 pc_data.data() + binding.push_constant_offset,
#define MF_RT_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
bool has_binding(const std::string &name) const
Check if binding exists.
void execute_shader(const std::shared_ptr< VKBuffer > &buffer) override
void bind_node(const std::string &name, const std::shared_ptr< Nodes::Node > &node, uint32_t offset, size_t size=sizeof(float))
Bind node output to push constant offset.
void update_push_constants_from_nodes()
std::unordered_map< std::string, NodeBinding > m_bindings
void unbind_node(const std::string &name)
Remove node binding.
std::vector< std::string > get_binding_names() const
Get all binding names.
const std::vector< uint8_t > & get_push_constant_data() const
Get current push constant data.
std::vector< uint8_t > m_push_constant_data
double extract_single_sample(const std::shared_ptr< Nodes::Node > &node)
Extract a single sample from a node with proper snapshot management.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.
std::shared_ptr< Nodes::Node > node