MayaFlux 0.4.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)

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.

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),
33 }
34
35 proc->add_binding("u_influence",
36 Buffers::ShaderBinding { 1, 0, 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,...)
@ UNIFORM
Uniform buffer (host-visible)
std::vector< std::shared_ptr< Buffers::RenderProcessor > > m_influence_targets
Definition Agent.hpp:295
std::shared_ptr< Buffers::VKBuffer > m_influence_ubo
Definition Agent.hpp:296
@ 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, MayaFlux::Buffers::VKBuffer::UNIFORM, and MayaFlux::Kakshya::UNKNOWN.