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

◆ flatten_channels_to_staging()

void MayaFlux::Yantra::GpuDispatchCore::flatten_channels_to_staging ( const std::vector< std::vector< double > > &  channels,
const DataStructureInfo structure_info 
)
protected

Flatten planar double channels into m_staging_floats.

Skipped for structured modalities (glm::vec3 etc.) since those are handled per-binding via PASSTHROUGH or integer paths.

Definition at line 347 of file GpuDispatchCore.cpp.

350{
351 m_staging_floats.clear();
352
353 if (Kakshya::is_structured_modality(structure_info.modality))
354 return;
355
356 bool all_inputs_staged = !m_bindings.empty();
357 for (size_t i = 0; i < m_bindings.size(); ++i) {
359 continue;
360 if (i >= m_binding_data.size() || m_binding_data[i].empty()) {
361 all_inputs_staged = false;
362 break;
363 }
364 }
365 if (all_inputs_staged)
366 return;
367
368 size_t total = 0;
369
370 for (const auto& ch : channels)
371 total += ch.size();
372 m_staging_floats.reserve(total);
373
374 for (const auto& ch : channels) {
375 for (double v : ch)
376 m_staging_floats.push_back(static_cast<float>(v));
377 }
378}
Range size
std::vector< std::vector< uint8_t > > m_binding_data
std::vector< GpuBufferBinding > m_bindings
bool is_structured_modality(DataModality modality)
Check if a modality represents structured data (vectors, matrices).
Definition NDData.hpp:115

References MayaFlux::Kakshya::is_structured_modality(), m_binding_data, m_bindings, m_staging_floats, MayaFlux::Yantra::DataStructureInfo::modality, and MayaFlux::Yantra::GpuBufferBinding::OUTPUT.

Referenced by prepare_gpu_inputs().

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