Called when this processor is attached to a buffer.
- Parameters
-
| buffer | Buffer this processor is being attached to |
Provides an opportunity for the processor to initialize buffer-specific state, allocate resources, or perform validation. With expanded processor capabilities, this method can also:
- Analyze Buffer Characteristics: Examine data type, size, and format requirements
- Select Optimal Backend: Choose the most appropriate processing backend for the buffer
- Initialize Hardware Resources: Set up GPU contexts, CUDA streams, or other acceleration
- Configure Processing Parameters: Adapt algorithm parameters to buffer characteristics
- Establish Processing Strategy: Determine whether to use sequential or parallel execution
- Validate Compatibility: Ensure the processor can handle the buffer's data type and format
Default implementation does nothing, but derived classes should override this method to leverage the full capabilities of the expanded processor architecture.
Reimplemented from MayaFlux::Buffers::BufferProcessor.
Definition at line 22 of file InstanceSSBOProcessor.cpp.
23{
26 "InstanceSSBOProcessor attached to empty network");
27 return;
28 }
29
30 auto vk_buf = std::dynamic_pointer_cast<VKBuffer>(buffer);
31 if (!vk_buf) {
33 "InstanceSSBOProcessor: attached buffer is not a VKBuffer");
34 return;
35 }
36
38
39 const size_t slot_count =
m_network->slot_count();
40
42
43 const size_t ssbo_bytes = slot_count * sizeof(glm::mat4);
47
49
53
55 "InstanceSSBOProcessor: {} slots, {} bytes template, {} bytes SSBO",
56 slot_count, vk_buf->get_size_bytes(), ssbo_bytes);
57}
#define MF_INFO(comp, ctx,...)
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
std::shared_ptr< VKBuffer > m_vertex_staging
void push_ssbo_binding(const std::shared_ptr< VKBuffer > &vertex_buf)
std::shared_ptr< Nodes::Network::InstanceNetwork > m_network
void upload_transforms(const std::shared_ptr< VKBuffer > &vertex_buf)
void upload_template(const std::shared_ptr< VKBuffer > &vertex_buf)
std::shared_ptr< VKBuffer > m_transform_ssbo
std::shared_ptr< VKBuffer > m_transform_staging
void ensure_initialized(const std::shared_ptr< VKBuffer > &buffer)
@ COMPUTE
Storage buffer for compute shaders (device-local)
std::shared_ptr< VKBuffer > create_staging_buffer(size_t size)
Create staging buffer for transfers.
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Init
Engine/subsystem initialization.
@ Buffers
Buffers, Managers, processors and processing chains.
@ UNKNOWN
Unknown or undefined modality.
References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Buffers::VKBuffer::COMPUTE, MayaFlux::Buffers::create_staging_buffer(), MayaFlux::Buffers::VKBufferProcessor::ensure_initialized(), MayaFlux::Journal::Init, m_network, m_transform_ssbo, m_transform_staging, m_vertex_staging, MF_ERROR, MF_INFO, MF_WARN, push_ssbo_binding(), MayaFlux::Kakshya::UNKNOWN, upload_template(), and upload_transforms().