39 bool initialise(
const std::string& key,
41 const std::vector<GpuBufferBinding>& bindings);
43 void ensure_buffer(
const std::string& key,
size_t index,
size_t required_bytes,
45 void upload(
const std::string& key,
size_t index,
const float* data,
size_t byte_size);
46 void upload_raw(
const std::string& key,
size_t index,
const uint8_t* data,
size_t byte_size);
47 void download(
const std::string& key,
size_t index,
float* dest,
size_t byte_size);
61 void bind_descriptors_batch(
const std::string& key,
const std::vector<GpuBufferBinding>& bindings);
63 void ensure_shared_buffer(uint32_t set,
size_t binding_index,
size_t element_count,
75 void bind_shared_descriptor(
const std::string& key, uint32_t set,
size_t binding_index,
const GpuBufferBinding& spec);
76 void download_shared(uint32_t set,
size_t binding_index,
void* dest,
size_t byte_size);
77 void upload_shared_raw(uint32_t set,
size_t binding_index,
const uint8_t* data,
size_t byte_size);
89 void bind_image_storage(
const std::string& key,
size_t index,
90 const std::shared_ptr<Core::VKImage>&
image,
101 void bind_image_sampled(
const std::string& key,
size_t index,
102 const std::shared_ptr<Core::VKImage>&
image,
112 std::shared_ptr<Core::VKImage>
image;
126 void bind_images_batch(
const std::string& key,
const std::vector<ImageBind>& images);
136 void transition_image(
const std::shared_ptr<Core::VKImage>&
image,
137 vk::ImageLayout old_layout,
138 vk::ImageLayout new_layout);
140 void dispatch(
const std::string& key,
141 const std::array<uint32_t, 3>& groups,
142 const std::vector<GpuBufferBinding>& bindings,
143 const uint8_t* push_constant_data,
144 size_t push_constant_size);
146 void dispatch_batched(
const std::string& key,
147 const std::array<uint32_t, 3>& groups,
148 const std::vector<GpuBufferBinding>& bindings,
149 size_t push_constant_size,
152 void dispatch_batched_indirect(
const std::string& key,
153 uint32_t indirect_set,
size_t indirect_binding,
154 const std::array<uint32_t, 3>& groups,
155 const std::vector<GpuBufferBinding>& bindings,
156 size_t push_constant_size,
176 const std::array<uint32_t, 3>& groups,
177 const std::vector<GpuBufferBinding>& bindings,
178 const uint8_t* push_constant_data,
179 size_t push_constant_size);
191 void dispatch_sequence(
192 const std::vector<std::string>& keys,
193 const std::vector<std::array<uint32_t, 3>>& groups_per_key,
194 const std::vector<std::vector<uint8_t>>& push_constants_per_key,
195 const std::vector<std::vector<Portal::Graphics::HazardResource>>& hazards_per_key,
196 const std::vector<Portal::Graphics::IndirectDispatch>& indirect_per_key = {});
216 const std::vector<std::string>& keys,
217 const std::vector<std::array<uint32_t, 3>>& groups_per_key,
218 const std::vector<std::vector<uint8_t>>& push_constants_per_key,
219 const std::vector<std::vector<Portal::Graphics::HazardResource>>& hazards_per_key,
220 const std::vector<Portal::Graphics::IndirectDispatch>& indirect_per_key = {});
226 void release(
const std::string& key);
233 [[nodiscard]]
bool is_ready(
const std::string& key)
const;
234 [[nodiscard]]
size_t buffer_allocated_bytes(
const std::string& key,
size_t index)
const;
242 std::unique_ptr<GpuResourceManagerImpl>
impl;
245 size_t allocated_bytes {};
261 const std::vector<std::string>& keys,
262 const std::vector<std::array<uint32_t, 3>>& groups_per_key,
263 const std::vector<std::vector<uint8_t>>& push_constants_per_key,
264 const std::vector<std::vector<Portal::Graphics::HazardResource>>& hazards_per_key,
265 const std::vector<Portal::Graphics::IndirectDispatch>& indirect_per_key);
267 struct SharedBuffers;
270 [[nodiscard]]
PipelineUnit& unit_for(
const std::string& key);
271 [[nodiscard]]
const PipelineUnit* find_unit(
const std::string& key)
const;
273 std::unordered_map<std::string, std::unique_ptr<PipelineUnit>>
m_units;
Context information controlling how a compute operation executes.