MayaFlux 0.2.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 37 of file NodeTextureBuffer.cpp.

38{
39 auto self = std::dynamic_pointer_cast<NodeTextureBuffer>(shared_from_this());
40
42
44 m_gpu_texture = loom.create_2d(
45 m_texture_node->get_width(),
46 m_texture_node->get_height(),
48 nullptr,
49 1);
50
51 if (!m_gpu_texture) {
52 error<std::runtime_error>(
55 std::source_location::current(),
56 "Failed to create GPU texture for NodeTextureBuffer '{}'",
58 }
59
60 m_texture_processor = std::make_shared<NodeTextureProcessor>();
61 m_texture_processor->set_processing_token(token);
62
63 m_texture_processor->bind_texture_node(
67
68 auto chain = get_processing_chain();
69 if (!chain) {
70 chain = std::make_shared<BufferProcessingChain>();
72 }
73 chain->set_preferred_token(token);
74
76
78 "NodeTextureBuffer '{}' ready: staging={} bytes, GPU texture={}x{}",
81 m_texture_node->get_width(),
82 m_texture_node->get_height());
83}
#define MF_INFO(comp, ctx,...)
static MayaFlux::Nodes::ProcessingToken token
Definition Timers.cpp:8
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:277
void set_default_processor(const std::shared_ptr< BufferProcessor > &processor) override
Set the buffer's default processor.
Definition VKBuffer.cpp:261
vk::DeviceSize get_size_bytes() const
Definition VKBuffer.hpp:235
void set_processing_chain(const std::shared_ptr< BufferProcessingChain > &chain, bool force=false) override
Replace the buffer's processing chain.
Definition VKBuffer.cpp:282
@ 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(), MayaFlux::Buffers::VKBuffer::set_processing_chain(), and token.

+ Here is the call graph for this function: