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

◆ add_influence_target()

void MayaFlux::Nexus::Agent::add_influence_target ( std::shared_ptr< Buffers::RenderProcessor proc,
uint32_t  set = 1,
uint32_t  binding = 0 
)

Add a render processor to receive GPU-side influence data.

Allocates the shared influence UBO on the first call. Subsequent calls bind the same UBO to the new processor: all targets receive identical context data each commit. Adding the same processor twice is a no-op.

Parameters
procRender processor to target. Ignored if null.
setDescriptor set index for the UBO binding. Default is 1.
bindingDescriptor binding index for the UBO. Default is 0.

Definition at line 16 of file Agent.cpp.

17{
18 if (!proc) {
20 "Cannot add null influence target");
21 return;
22 }
23
24 if (std::ranges::find(m_influence_targets, proc) != m_influence_targets.end()) {
25 return;
26 }
27
28 if (!m_influence_ubo) {
29 m_influence_ubo = std::make_shared<Buffers::VKBuffer>(
30 sizeof(InfluenceUBO),
31 Buffers::VKBuffer::Usage::UNIFORM,
33 }
34
35 proc->add_binding("u_influence",
36 Buffers::ShaderBinding { set, binding, vk::DescriptorType::eUniformBuffer });
37
38 proc->bind_buffer("u_influence", m_influence_ubo);
39
40 m_influence_targets.push_back(std::move(proc));
41}
#define MF_ERROR(comp, ctx,...)
std::vector< std::shared_ptr< Buffers::RenderProcessor > > m_influence_targets
Definition Agent.hpp:298
std::shared_ptr< Buffers::VKBuffer > m_influence_ubo
Definition Agent.hpp:299
@ Init
Engine/subsystem initialization.
@ Nexus
Spatial indexing and scheduling for user-defined behaviour.
@ UNKNOWN
Unknown or undefined modality.

References MayaFlux::Journal::Init, m_influence_targets, m_influence_ubo, MF_ERROR, MayaFlux::Journal::Nexus, and MayaFlux::Kakshya::UNKNOWN.