|
MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
|
Shader context whose numeric input is staged as a uvec2 per double. More...
#include <WordPairExecutionContext.hpp>
Public Member Functions | |
| std::vector< double > | decode_primary (const GpuChannelResult &result) const |
| Decode a dispatch result, as returned by an asynchronous collect, to doubles. | |
| std::vector< double > | download_words (size_t binding, size_t count) |
| Read a binding back as doubles after a recorded stage. | |
| bool | order_keyed () const noexcept |
| std::span< const double > | primary_values () const noexcept |
| The primary output of the last dispatch decoded to doubles. | |
| std::span< const uint32_t > | primary_words () const noexcept |
| The primary output of the last dispatch as 32-bit words, empty if it produced none. | |
| void | stage_words (uint32_t binding, std::span< const double > values, size_t padded_count=0, bool complement=false) |
| Encode values and stage them as the data of a binding. | |
| WordPairExecutionContext (GpuComputeConfig config, std::vector< GpuBufferBinding > bindings, bool order_key, std::string name="WordPairExecutionContext") | |
| Public Member Functions inherited from MayaFlux::Yantra::ShaderExecutionContext< InputType, OutputType > | |
| GpuChannelResult | collect_result () |
| Collect the result of the last async dispatch. | |
| Portal::Graphics::FenceID | dispatch_async (const input_type &input) |
| Dispatch asynchronously and return a fence for polling. | |
| output_type | execute (const input_type &input, const ExecutionContext &ctx) override |
| Injects multipass configuration into the context before dispatch when set_multipass() has been called. | |
| template<typename T> | |
| ShaderExecutionContext & | in_out (const std::vector< T > &data, GpuBufferBinding::ElementType type=GpuBufferBinding::ElementType::FLOAT32) |
| Add an INPUT_OUTPUT binding, inferring the next available binding index. | |
| ShaderExecutionContext & | in_out (GpuBufferBinding::ElementType type=GpuBufferBinding::ElementType::FLOAT32) |
| Declare an INPUT_OUTPUT binding at an explicit index without pre-staging data. | |
| template<typename T> | |
| ShaderExecutionContext & | in_out (uint32_t binding, const std::vector< T > &data, GpuBufferBinding::ElementType type=GpuBufferBinding::ElementType::FLOAT32) |
| Add an INPUT_OUTPUT binding at an explicit index. | |
| ShaderExecutionContext & | in_out (uint32_t binding, GpuBufferBinding::ElementType type=GpuBufferBinding::ElementType::FLOAT32) |
| Declare an INPUT_OUTPUT binding without pre-staging data. | |
| template<typename T> | |
| ShaderExecutionContext & | input (const std::vector< T > &data, GpuBufferBinding::ElementType type=GpuBufferBinding::ElementType::FLOAT32) |
| Add an INPUT binding, inferring the next available binding index. | |
| template<typename T> | |
| ShaderExecutionContext & | input (uint32_t binding, const std::vector< T > &data, GpuBufferBinding::ElementType type=GpuBufferBinding::ElementType::FLOAT32) |
| Add an INPUT binding at an explicit index. | |
| ShaderExecutionContext & | output (size_t byte_size, GpuBufferBinding::ElementType type=GpuBufferBinding::ElementType::FLOAT32) |
| Add an OUTPUT binding, inferring the next available binding index. | |
| ShaderExecutionContext & | output (uint32_t binding, size_t byte_size, GpuBufferBinding::ElementType type=GpuBufferBinding::ElementType::FLOAT32) |
| Add an OUTPUT binding at an explicit index. | |
| template<typename T> | |
| ShaderExecutionContext & | push (const T &data) |
| Set push constants from a trivially copyable struct or value. | |
| ShaderExecutionContext & | set_multipass (uint32_t pass_count, std::function< void(uint32_t, void *)> pc_updater) |
| Configure multi-pass (CHAINED) dispatch. | |
| void | set_skip_readback (uint32_t binding, bool skip) |
| Set or clear skip_auto_readback for a binding by index. | |
| ShaderExecutionContext (GpuComputeConfig config, std::vector< GpuBufferBinding > bindings={}, std::string name="ShaderExecutionContext", bool compute_isolated=true) | |
| Construct with shader config and optional pre-built binding list. | |
| Public Member Functions inherited from MayaFlux::Yantra::GpuExecutionContext< InputType, OutputType > | |
| GpuExecutionContext (const GpuExecutionContext &)=delete | |
| GpuExecutionContext (GpuComputeConfig config, bool compute_isolated=true) | |
| GpuExecutionContext (GpuExecutionContext &&)=delete | |
| GpuExecutionContext & | operator= (const GpuExecutionContext &)=delete |
| GpuExecutionContext & | operator= (GpuExecutionContext &&)=delete |
| ~GpuExecutionContext () override=default | |
| Public Member Functions inherited from MayaFlux::Yantra::GpuDispatchCore | |
| const std::string & | dispatch_key () const |
| The key used for this context's GpuResourceManager unit. | |
| void | download_binding (size_t index, void *dest, size_t byte_size) |
| Read back a specific binding into a caller-provided destination. | |
| void | download_shared (uint32_t set, size_t binding_index, void *dest, size_t byte_size) |
| bool | ensure_gpu_ready () |
| Ensure GPU resources are initialised. | |
| void | ensure_shared_buffer (uint32_t set, size_t binding_index, size_t element_count, GpuBufferBinding::ElementType element_type, Portal::Graphics::BufferUsageHint usage_hint=Portal::Graphics::BufferUsageHint::COMPUTE_STORAGE) |
| Ensure a shared storage buffer of at least element_count elements exists at (set, binding_index). | |
| void | fill_shared (uint32_t set, size_t binding_index, uint32_t value) |
| Fill the whole shared buffer at (set, binding_index) with one 32-bit value, in order with the recorded dispatches. | |
| 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 (GpuComputeConfig config, bool compute_isolated=true) | |
| GpuDispatchCore (GpuDispatchCore &&)=delete | |
| void | import_shared (uint32_t set, size_t binding_index, const GpuDispatchCore &source, uint32_t source_set, size_t source_binding_index, GpuBufferBinding::ElementType element_type) |
| Resolve a binding of this context to a shared buffer owned by another context. | |
| bool | is_gpu_ready () const |
| Query GPU readiness without attempting initialisation. | |
| GpuDispatchCore & | operator= (const GpuDispatchCore &)=delete |
| GpuDispatchCore & | operator= (GpuDispatchCore &&)=delete |
| void | record_stages (const std::vector< DependencyStage > &stages) |
| Stage and record each stage in order, one dispatch per stage. | |
| 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. | |
| void | set_recording (std::shared_ptr< GpuDispatchRecorder > recording) |
| Append this context's work to a recording shared with other contexts. | |
| uint64_t | shared_buffer_address (uint32_t set, size_t binding_index) const |
| Device address of the shared buffer at (set, binding_index), or zero when absent. | |
| Portal::Graphics::GpuBufferHandle | shared_buffer_handle (uint32_t set, size_t binding_index) const |
| Non-owning view of the shared buffer at (set, binding_index). | |
| std::optional< SharedBufferInfo > | shared_buffer_info (uint32_t set, size_t binding_index) const |
| What the shared buffer at (set, binding_index) declares, or nothing when absent. | |
| void | stage_image_at (size_t binding_index, std::shared_ptr< Core::VKImage > image, GpuBufferBinding::ElementType kind, vk::Sampler sampler=nullptr) |
| Register a VKImage at an explicit binding index. | |
| void | swap_shader (GpuComputeConfig config) |
| Switch which shader subsequent dispatch_core calls target. | |
| void | upload_shared_raw (uint32_t set, size_t binding_index, const uint8_t *data, size_t byte_size) |
| virtual | ~GpuDispatchCore ()=default |
Protected Member Functions | |
| output_type | collect_gpu_outputs (const GpuChannelResult &raw, const std::vector< std::vector< double > > &, const DataStructureInfo &) override |
| Keeps the primary output as words; the context returns no Datum. | |
| Protected Member Functions inherited from MayaFlux::Yantra::ShaderExecutionContext< InputType, OutputType > | |
| std::vector< GpuBufferBinding > | declare_buffer_bindings () const override |
| Returns the binding list declared via constructor or fluent API. | |
| Protected Member Functions inherited from MayaFlux::Yantra::GpuExecutionContext< InputType, OutputType > | |
| virtual std::pair< std::vector< std::vector< double > >, DataStructureInfo > | extract_inputs (const input_type &input) |
| Extract channel data 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. | |
| GpuChannelResult | dispatch_core (const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info) |
| Full single-pass dispatch. | |
| Portal::Graphics::FenceID | dispatch_core_async (const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info) |
| Non-blocking variant of dispatch_core. | |
| GpuChannelResult | dispatch_core_chained (const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info, const ExecutionContext &ctx) |
| Multi-pass (chained) dispatch. | |
| GpuChannelResult | dispatch_core_chained_indirect (const std::vector< std::vector< double > > &channels, const DataStructureInfo &structure_info, const ExecutionContext &ctx) |
| Multi-pass dispatch where a GPU-resident indirect buffer gates each pass's workgroup count instead of a fixed pass_count. | |
| 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. | |
| void | flatten_native_variants_to_staging (const std::vector< Kakshya::DataVariant > &variants, const DataStructureInfo &structure_info) |
| Flatten native-typed DataVariant channels into m_native_staging_bytes without any conversion. | |
| const GpuComputeConfig & | gpu_config () const |
| size_t | largest_binding_data_element_count () const |
| size_t | last_effective_element_count () const |
| Effective element count used by the last dispatch_core or dispatch_core_async call. | |
| 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_native_bytes (Kakshya::GpuDataFormat format, const void *data, size_t byte_size) |
| Stage raw input bytes of one element type for the next dispatch. | |
| void | stage_passthrough (size_t binding_index, const void *data, size_t byte_size) |
| Stage raw bytes for a PASSTHROUGH binding before dispatch. | |
Private Attributes | |
| bool | m_order_key |
| std::vector< double > | m_primary_values |
| std::vector< uint32_t > | m_primary_words |
Additional Inherited Members | |
| Public Types inherited from MayaFlux::Yantra::ShaderExecutionContext< InputType, OutputType > | |
| using | input_type = typename GpuExecutionContext<InputType, OutputType>::input_type |
| using | output_type = typename GpuExecutionContext<InputType, OutputType>::output_type |
| Public Types inherited from MayaFlux::Yantra::GpuExecutionContext< InputType, OutputType > | |
| using | input_type = Datum<InputType> |
| using | output_type = Datum<OutputType> |
| Static Public Member Functions inherited from MayaFlux::Yantra::ShaderExecutionContext< InputType, OutputType > | |
| template<typename T> | |
| static std::vector< T > | read_output (const Datum< std::vector< Kakshya::DataVariant > > &result, size_t binding_index) |
| Read a typed output buffer from a pipeline result Datum. | |
| 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 |
Shader context whose numeric input is staged as a uvec2 per double.
Each double is encoded as one 64-bit word, low word first, so the shader sees a VEC2_U32 binding and needs neither shaderFloat64 nor lossy narrowing to float. The word is the double's order key, whose unsigned order is the numeric order, or its IEEE 754 bits unchanged. The context stages any binding from a span of doubles. The primary output of a dispatch is kept as raw words, and in IEEE mode also decoded to doubles. Element types are set by the caller. Bindings, push constants and multipass come from ShaderExecutionContext.
Definition at line 26 of file WordPairExecutionContext.hpp.