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);
48 void bind_descriptor(
const std::string& key,
size_t index,
const GpuBufferBinding& spec);
50 void ensure_shared_buffer(uint32_t set,
size_t binding_index,
size_t element_count,
53 void bind_shared_descriptor(
const std::string& key, uint32_t set,
size_t binding_index,
const GpuBufferBinding& spec);
54 void download_shared(uint32_t set,
size_t binding_index,
void* dest,
size_t byte_size);
55 void upload_shared_raw(uint32_t set,
size_t binding_index,
const uint8_t* data,
size_t byte_size);
67 void bind_image_storage(
const std::string& key,
size_t index,
68 const std::shared_ptr<Core::VKImage>&
image,
79 void bind_image_sampled(
const std::string& key,
size_t index,
80 const std::shared_ptr<Core::VKImage>&
image,
92 void transition_image(
const std::shared_ptr<Core::VKImage>&
image,
93 vk::ImageLayout old_layout,
94 vk::ImageLayout new_layout);
96 void dispatch(
const std::string& key,
97 const std::array<uint32_t, 3>& groups,
98 const std::vector<GpuBufferBinding>& bindings,
99 const uint8_t* push_constant_data,
100 size_t push_constant_size);
102 void dispatch_batched(
const std::string& key,
103 const std::array<uint32_t, 3>& groups,
104 const std::vector<GpuBufferBinding>& bindings,
105 size_t push_constant_size,
108 void dispatch_batched_indirect(
const std::string& key,
109 uint32_t indirect_set,
size_t indirect_binding,
110 const std::array<uint32_t, 3>& groups,
111 const std::vector<GpuBufferBinding>& bindings,
112 size_t push_constant_size,
132 const std::array<uint32_t, 3>& groups,
133 const std::vector<GpuBufferBinding>& bindings,
134 const uint8_t* push_constant_data,
135 size_t push_constant_size);
144 void dispatch_sequence(
145 const std::vector<std::string>& keys,
146 const std::vector<std::array<uint32_t, 3>>& groups_per_key,
147 const std::vector<std::vector<uint8_t>>& push_constants_per_key,
148 const std::vector<std::vector<Portal::Graphics::HazardResource>>& hazards_per_key);
154 void release(
const std::string& key);
161 [[nodiscard]]
bool is_ready(
const std::string& key)
const;
162 [[nodiscard]]
size_t buffer_allocated_bytes(
const std::string& key,
size_t index)
const;
170 std::unique_ptr<GpuResourceManagerImpl>
impl;
173 size_t allocated_bytes {};
181 struct SharedBuffers;
184 [[nodiscard]]
PipelineUnit& unit_for(
const std::string& key);
185 [[nodiscard]]
const PipelineUnit* find_unit(
const std::string& key)
const;
187 std::unordered_map<std::string, std::unique_ptr<PipelineUnit>>
m_units;
Context information controlling how a compute operation executes.