21 std::unordered_map<size_t, std::vector<uint8_t>>
aux;
52 void set_push_constants(
const void* data,
size_t bytes);
61 set_push_constants(&data,
sizeof(T));
74 if (index >= m_binding_data.size())
75 m_binding_data.resize(index + 1);
76 auto& slot = m_binding_data[index];
77 slot.resize(data.size_bytes());
78 std::memcpy(slot.data(), data.data(), data.size_bytes());
84 set_binding_data(index, std::span<const T>(data));
94 void set_output_size(
size_t index,
size_t byte_size);
100 bool ensure_gpu_ready();
105 [[nodiscard]]
bool is_gpu_ready()
const;
117 [[nodiscard]] std::shared_ptr<Core::VKImage> get_output_image(
size_t binding_index)
const;
125 [[nodiscard]]
virtual std::vector<GpuBufferBinding> declare_buffer_bindings()
const;
131 virtual void on_before_gpu_dispatch(
132 const std::vector<std::vector<double>>& channels,
141 virtual void prepare_gpu_inputs(
142 const std::vector<std::vector<double>>& channels,
154 [[nodiscard]]
virtual std::array<uint32_t, 3> calculate_dispatch_size(
155 size_t total_elements,
164 void stage_passthrough(
size_t binding_index,
const void* data,
size_t byte_size);
174 void stage_image_storage(
size_t binding_index, std::shared_ptr<Core::VKImage>
image);
185 void stage_image_sampled(
size_t binding_index,
186 std::shared_ptr<Core::VKImage>
image,
187 vk::Sampler sampler);
200 const std::vector<std::vector<double>>& channels,
213 const std::vector<std::vector<double>>& channels,
226 [[nodiscard]] std::vector<float> readback_primary(
size_t float_count);
242 void flatten_channels_to_staging(
243 const std::vector<std::vector<double>>& channels,
246 [[nodiscard]]
size_t find_first_output_index()
const;
247 [[nodiscard]]
size_t largest_binding_data_element_count()
const;
258 std::shared_ptr<Core::VKImage>
image;
std::vector< ImageBinding > m_image_bindings
GpuResourceManager m_resources
GpuShaderConfig m_gpu_config
GpuDispatchCore(GpuDispatchCore &&)=delete
std::vector< uint8_t > m_push_constants
void set_binding_data(size_t index, const std::vector< T > &data)
std::vector< std::vector< uint8_t > > m_binding_data
std::vector< GpuBufferBinding > m_bindings
std::vector< size_t > m_output_size_overrides
virtual ~GpuDispatchCore()=default
void set_push_constants(const T &data)
Typed convenience wrapper for set_push_constants(const void*, size_t).
GpuDispatchCore & operator=(GpuDispatchCore &&)=delete
std::vector< std::vector< uint8_t > > m_passthrough_bytes
std::vector< float > m_staging_floats
GpuDispatchCore(const GpuDispatchCore &)=delete
GpuDispatchCore & operator=(const GpuDispatchCore &)=delete
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 pr...
Non-template base that owns all type-independent GPU dispatch logic.
Encapsulates all Vulkan resource lifecycle behind Portal facades.
Metadata about data structure for reconstruction.
Context information controlling how a compute operation executes.
ElementType
Element type the shader expects in this buffer.
std::unordered_map< size_t, std::vector< uint8_t > > aux
std::vector< float > primary
Erased output of a GPU dispatch: reconstructed float data plus any raw auxiliary outputs keyed by bin...
std::shared_ptr< Core::VKImage > image
Plain-data description of the compute shader to dispatch.