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 93 of file TransferProcessor.cpp.
94{
96 if (auto vk_buffer = std::dynamic_pointer_cast<VKBuffer>(buffer)) {
99 "TransferProcessor not configured for the attached VKBuffer instance (audio→gpu).");
100 return;
101 }
102
103 if (!vk_buffer->is_initialized()) {
105 "VKBuffer not initialized - register with BufferManager first.");
106 return;
107 }
108
109 if (!vk_buffer->is_host_visible()) {
113 "No staging buffer configured for device-local VKBuffer. Create one for efficient transfers.");
114 }
115 }
116 } else {
118 std::source_location::current(),
119 "TransferProcessor (audio→gpu) requires VKBuffer attachment");
120 }
121
123 if (auto audio_buffer = std::dynamic_pointer_cast<AudioBuffer>(buffer)) {
126 "TransferProcessor not configured for the attached AudioBuffer instance (gpu→audio).");
127 return;
128 }
129 } else {
131 std::source_location::current(),
132 "TransferProcessor (gpu→audio) requires AudioBuffer attachment");
133 }
134 }
135}
#define MF_ERROR(comp, ctx,...)
#define MF_WARN(comp, ctx,...)
bool validate_audio_to_gpu(const std::shared_ptr< VKBuffer > &target) const
bool validate_gpu_to_audio(const std::shared_ptr< AudioBuffer > &target) const
TransferDirection m_direction
std::unordered_map< std::shared_ptr< VKBuffer >, std::shared_ptr< VKBuffer > > m_staging_map
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.
References MayaFlux::Buffers::AUDIO_TO_GPU, MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, MayaFlux::Buffers::GPU_TO_AUDIO, m_direction, m_staging_map, MF_ERROR, MF_WARN, validate_audio_to_gpu(), and validate_gpu_to_audio().