|
MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
|
Type-parameterised shell over GpuDispatchCore. More...
#include <GpuExecutionContext.hpp>
Inheritance diagram for MayaFlux::Yantra::GpuExecutionContext< InputType, OutputType >:
Collaboration diagram for MayaFlux::Yantra::GpuExecutionContext< InputType, OutputType >:Public Types | |
| using | input_type = Datum< InputType > |
| using | output_type = Datum< OutputType > |
Public Member Functions | |
| virtual output_type | execute (const input_type &input, const ExecutionContext &ctx) |
| Dispatch to GPU and reconstruct a typed output Datum. | |
| GpuExecutionContext (const GpuExecutionContext &)=delete | |
| GpuExecutionContext (GpuExecutionContext &&)=delete | |
| GpuExecutionContext (GpuShaderConfig config) | |
| GpuExecutionContext & | operator= (const GpuExecutionContext &)=delete |
| GpuExecutionContext & | operator= (GpuExecutionContext &&)=delete |
| ~GpuExecutionContext () override=default | |
Public Member Functions inherited from MayaFlux::Yantra::GpuDispatchCore | |
| bool | ensure_gpu_ready () |
| Ensure GPU resources are initialised. | |
| std::shared_ptr< Core::VKImage > | get_output_image (size_t binding_index) const |
| Return the image registered at an IMAGE_STORAGE output binding. | |
| GpuDispatchCore (const GpuDispatchCore &)=delete | |
| GpuDispatchCore (GpuDispatchCore &&)=delete | |
| GpuDispatchCore (GpuShaderConfig config) | |
| bool | is_gpu_ready () const |
| Query GPU readiness without attempting initialisation. | |
| GpuDispatchCore & | operator= (const GpuDispatchCore &)=delete |
| GpuDispatchCore & | operator= (GpuDispatchCore &&)=delete |
| template<typename T > | |
| void | set_binding_data (size_t index, const std::vector< T > &data) |
| template<typename T > | |
| void | set_binding_data (size_t index, std::span< const T > data) |
| Pre-stage typed data for a specific binding slot, bypassing the default channel-flattening path in prepare_gpu_inputs. | |
| void | set_output_size (size_t index, size_t byte_size) |
| Declare the byte capacity of an output binding independently of input data. | |
| template<typename T > | |
| void | set_push_constants (const T &data) |
| Typed convenience wrapper for set_push_constants(const void*, size_t). | |
| void | set_push_constants (const void *data, size_t bytes) |
| Set push constant data from a raw byte pointer. | |
| virtual | ~GpuDispatchCore ()=default |
Protected Member Functions | |
| virtual output_type | collect_gpu_outputs (const GpuChannelResult &raw, const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info) |
| Reconstruct Datum<OutputType> from a GpuChannelResult. | |
| virtual std::pair< std::vector< std::vector< double > >, DataStructureInfo > | extract_inputs (const input_type &input) |
| Extract double channels and structure metadata from the input Datum. | |
Protected Member Functions inherited from MayaFlux::Yantra::GpuDispatchCore | |
| 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. | |
| virtual std::vector< GpuBufferBinding > | declare_buffer_bindings () const |
| Declare the storage buffers the shader expects. | |
| GpuChannelResult | dispatch_core (const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info) |
| Full single-pass dispatch. | |
| GpuChannelResult | dispatch_core_chained (const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info, const ExecutionContext &ctx) |
| Multi-pass (chained) dispatch. | |
| size_t | find_first_output_index () const |
| void | flatten_channels_to_staging (const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info) |
| Flatten planar double channels into m_staging_floats. | |
| const GpuShaderConfig & | gpu_config () const |
| size_t | largest_binding_data_element_count () const |
| virtual void | on_before_gpu_dispatch (const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info) |
| Called immediately before dispatch. | |
| virtual void | prepare_gpu_inputs (const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info) |
| Marshal channel data into GPU input buffers. | |
| void | readback_aux (GpuChannelResult &result) |
| Read back all OUTPUT bindings that have explicit size overrides into the aux map of a GpuChannelResult. | |
| std::vector< float > | readback_primary (size_t float_count) |
| Read back the primary output buffer into a float vector. | |
| void | stage_image_sampled (size_t binding_index, std::shared_ptr< Core::VKImage > image, vk::Sampler sampler) |
| Register a VKImage + sampler for an IMAGE_SAMPLED binding. | |
| void | stage_image_storage (size_t binding_index, std::shared_ptr< Core::VKImage > image) |
| Register a VKImage for an IMAGE_STORAGE binding. | |
| void | stage_passthrough (size_t binding_index, const void *data, size_t byte_size) |
| Stage raw bytes for a PASSTHROUGH binding before dispatch. | |
Additional Inherited Members | |
Protected Attributes inherited from MayaFlux::Yantra::GpuDispatchCore | |
| std::vector< std::vector< uint8_t > > | m_binding_data |
| std::vector< GpuBufferBinding > | m_bindings |
| std::vector< ImageBinding > | m_image_bindings |
| std::vector< size_t > | m_output_size_overrides |
| std::vector< std::vector< uint8_t > > | m_passthrough_bytes |
| std::vector< uint8_t > | m_push_constants |
| GpuResourceManager | m_resources |
| std::vector< float > | m_staging_floats |
Type-parameterised shell over GpuDispatchCore.
Handles the two type-aware boundary steps:
All resource management, buffer staging, dispatch orchestration, and virtual override points live in GpuDispatchCore and are compiled once in GpuDispatchCore.cpp.
Subclasses override GpuDispatchCore virtuals (declare_buffer_bindings, on_before_gpu_dispatch, prepare_gpu_inputs, calculate_dispatch_size) directly; Subclasses that do not operate on numeric channels (e.g. image-only shaders) override extract_inputs() to return empty channels and override collect_gpu_outputs() to pull from get_output_image() instead of the float readback.
| InputType | ComputeData type accepted. |
| OutputType | ComputeData type produced. |
Definition at line 32 of file GpuExecutionContext.hpp.