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

◆ register_buffer()

MAYAFLUX_API void MayaFlux::register_buffer ( const std::shared_ptr< Buffers::Buffer > &  buffer,
const CreationContext ctx 
)

Definition at line 75 of file Creator.cpp.

76{
77 auto token = get_buffer_token(ctx.domain.value());
78
79 if (auto audio_buffer = std::dynamic_pointer_cast<Buffers::AudioBuffer>(buffer)) {
80 if (ctx.channel.has_value()) {
81 register_audio_buffer(audio_buffer, ctx.channel.value());
82 } else if (ctx.channels.has_value()) {
83 register_audio_buffer(audio_buffer, ctx.channels.value()[0]);
84 for (size_t i = 1; i < ctx.channels.value().size(); ++i) {
85 clone_buffer_to_channels(audio_buffer, { static_cast<uint32_t>(i) }, token);
86 }
87 } else {
88 register_audio_buffer(audio_buffer, audio_buffer->get_channel_id());
89 }
90 return;
91 }
92
93 if (auto vk_buffer = std::dynamic_pointer_cast<Buffers::VKBuffer>(buffer)) {
94 register_graphics_buffer(vk_buffer, token);
95 return;
96 }
97}
void register_audio_buffer(const std::shared_ptr< Buffers::AudioBuffer > &buffer, uint32_t channel)
Registers an AudioBuffer with the default engine's buffer manager.
Definition Graph.cpp:229
void register_graphics_buffer(const std::shared_ptr< Buffers::VKBuffer > &buffer, Buffers::ProcessingToken token)
Registers a VKBuffer with the default engine's buffer manager.
Definition Graph.cpp:239
MAYAFLUX_API Buffers::ProcessingToken get_buffer_token(Domain domain)
Extracts buffer processing token from domain.
Definition Domain.hpp:184
std::optional< uint32_t > channel
Definition Creator.hpp:21
std::optional< std::vector< uint32_t > > channels
Definition Creator.hpp:22
std::optional< Domain > domain
Definition Creator.hpp:20

References MayaFlux::CreationContext::channel, MayaFlux::CreationContext::channels, clone_buffer_to_channels(), MayaFlux::CreationContext::domain, get_buffer_token(), register_audio_buffer(), and register_graphics_buffer().

Referenced by MayaFlux::MeshGroupHandle::operator|(), and operator|().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: