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

◆ setup_processors()

void MayaFlux::Buffers::NodeTextureBuffer::setup_processors ( ProcessingToken  token)
overridevirtual

Initialize the buffer, create GPU texture, and setup processors.

Reimplemented from MayaFlux::Buffers::VKBuffer.

Definition at line 45 of file NodeTextureBuffer.cpp.

46{
47 auto self = std::dynamic_pointer_cast<NodeTextureBuffer>(shared_from_this());
48
50
52 m_gpu_texture = loom.create_2d(
53 m_texture_node->get_width(),
54 m_texture_node->get_height(),
56 nullptr,
57 1);
58
59 if (!m_gpu_texture) {
60 error<std::runtime_error>(
63 std::source_location::current(),
64 "Failed to create GPU texture for NodeTextureBuffer '{}'",
66 }
67
68 m_texture_processor = std::make_shared<NodeTextureProcessor>();
69 m_texture_processor->set_processing_token(token);
70
71 m_texture_processor->bind_texture_node(
75
76 auto chain = get_processing_chain();
77 if (!chain) {
78 chain = std::make_shared<BufferProcessingChain>();
80 }
81 chain->set_preferred_token(token);
82
84
86 "NodeTextureBuffer '{}' ready: staging={} bytes, GPU texture={}x{}",
89 m_texture_node->get_width(),
90 m_texture_node->get_height());
91}
#define MF_INFO(comp, ctx,...)
std::shared_ptr< Nodes::GpuSync::TextureNode > m_texture_node
std::shared_ptr< Core::VKImage > m_gpu_texture
std::shared_ptr< NodeTextureProcessor > m_texture_processor
std::shared_ptr< Buffers::BufferProcessingChain > get_processing_chain() override
Access the buffer's processing chain.
Definition VKBuffer.cpp:274
void set_default_processor(const std::shared_ptr< BufferProcessor > &processor) override
Set the buffer's default processor.
Definition VKBuffer.cpp:258
vk::DeviceSize get_size_bytes() const
Definition VKBuffer.hpp:237
void set_processing_chain(const std::shared_ptr< BufferProcessingChain > &chain, bool force=false) override
Replace the buffer's processing chain.
Definition VKBuffer.cpp:279
@ Init
Engine/subsystem initialization.
@ Buffers
Buffers, Managers, processors and processing chains.
MAYAFLUX_API TextureLoom & get_texture_manager()
Get the global texture manager instance.
@ RGBA32F
Four channel 32-bit float.

References MayaFlux::Journal::Buffers, generate_fullscreen_quad(), MayaFlux::Buffers::VKBuffer::get_processing_chain(), MayaFlux::Buffers::VKBuffer::get_size_bytes(), MayaFlux::Portal::Graphics::get_texture_manager(), MayaFlux::Journal::Init, m_binding_name, m_gpu_texture, m_texture_node, m_texture_processor, MF_INFO, MayaFlux::Portal::Graphics::RGBA32F, MayaFlux::Buffers::VKBuffer::set_default_processor(), and MayaFlux::Buffers::VKBuffer::set_processing_chain().

+ Here is the call graph for this function: