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 73 of file Creator.cpp.

74{
75 auto token = get_buffer_token(ctx.domain.value());
76
77 if (auto audio_buffer = std::dynamic_pointer_cast<Buffers::AudioBuffer>(buffer)) {
78 if (ctx.channel.has_value()) {
79 register_audio_buffer(audio_buffer, ctx.channel.value());
80 } else if (ctx.channels.has_value()) {
81 register_audio_buffer(audio_buffer, ctx.channels.value()[0]);
82 for (size_t i = 1; i < ctx.channels.value().size(); ++i) {
83 clone_buffer_to_channels(audio_buffer, { static_cast<uint32_t>(i) }, token);
84 }
85 } else {
86 register_audio_buffer(audio_buffer, audio_buffer->get_channel_id());
87 }
88 return;
89 }
90
91 if (auto vk_buffer = std::dynamic_pointer_cast<Buffers::VKBuffer>(buffer)) {
92 register_graphics_buffer(vk_buffer, token);
93 return;
94 }
95}
Range size
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:230
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:240
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:22
std::optional< std::vector< uint32_t > > channels
Definition Creator.hpp:23
std::optional< Domain > domain
Definition Creator.hpp:21

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

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

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