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

◆ collect_result()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = InputType>
GpuChannelResult MayaFlux::Yantra::ShaderExecutionContext< InputType, OutputType >::collect_result ( )
inline

Collect the result of the last async dispatch.

Must be called only after ShaderFoundry::is_fence_signaled returns true for the FenceID returned by dispatch_async. Calls readback_primary and readback_aux using the element count cached by dispatch_core_async.

Returns
GpuChannelResult with primary float data and aux buffers.

Definition at line 366 of file ShaderExecutionContext.hpp.

367 {
368 GpuChannelResult result;
369 result.primary = this->readback_primary(this->last_effective_element_count());
370 this->readback_aux(result);
371 return result;
372 }
void readback_aux(GpuChannelResult &result)
Read back all OUTPUT bindings that have explicit size overrides into the aux map of a GpuChannelResul...
size_t last_effective_element_count() const
Effective element count used by the last dispatch_core or dispatch_core_async call.
std::vector< float > readback_primary(size_t float_count)
Read back the primary output buffer into a float vector.

References MayaFlux::Yantra::GpuChannelResult::primary.