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

◆ dispatch_core_chained()

GpuChannelResult MayaFlux::Yantra::GpuDispatchCore::dispatch_core_chained ( const std::vector< std::vector< double > > &  channels,
const DataStructureInfo structure_info,
const ExecutionContext ctx 
)
protected

Multi-pass (chained) dispatch.

Calls dispatch_batched on GpuResourceManager and reads back once after all passes.

Parameters
channelsExtracted double channels.
structure_infoDimension/modality metadata.
ctxExecutionContext carrying pass_count and pc_updater.
Returns
GpuChannelResult containing primary float readback and aux buffers.

Definition at line 269 of file GpuDispatchCore.cpp.

273{
274 on_before_gpu_dispatch(channels, structure_info);
275 prepare_gpu_inputs(channels, structure_info);
276
278
279 const size_t effective = m_staging_floats.empty()
281 : m_staging_floats.size();
282 const auto groups = calculate_dispatch_size(effective, structure_info);
283
285 dispatch_key(), groups, m_bindings,
287
288 GpuChannelResult result;
289 result.primary = readback_primary(effective);
290 readback_aux(result);
291 return result;
292}
void readback_aux(GpuChannelResult &result)
Read back all OUTPUT bindings that have explicit size overrides into the aux map of a GpuChannelResul...
virtual std::array< uint32_t, 3 > calculate_dispatch_size(size_t total_elements, const DataStructureInfo &structure_info) const
Calculate workgroup dispatch counts from structure dimensions.
const std::string & dispatch_key() const
The key used for this context's GpuResourceManager unit.
std::vector< GpuBufferBinding > m_bindings
virtual void prepare_gpu_inputs(const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info)
Marshal channel data into GPU input buffers.
virtual void on_before_gpu_dispatch(const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info)
Called immediately before dispatch.
std::vector< float > readback_primary(size_t float_count)
Read back the primary output buffer into a float vector.
void dispatch_batched(const std::string &key, const std::array< uint32_t, 3 > &groups, const std::vector< GpuBufferBinding > &bindings, size_t push_constant_size, const ExecutionContext &ctx)

References bind_all_descriptors(), calculate_dispatch_size(), MayaFlux::Yantra::GpuResourceManager::dispatch_batched(), dispatch_key(), largest_binding_data_element_count(), m_bindings, m_gpu_config, m_resources, m_staging_floats, on_before_gpu_dispatch(), prepare_gpu_inputs(), MayaFlux::Yantra::GpuChannelResult::primary, MayaFlux::Portal::Graphics::GpuComputeConfig::push_constant_size, readback_aux(), and readback_primary().

Referenced by MayaFlux::Yantra::GpuExecutionContext< InputType, OutputType >::execute().

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