mirror of
https://github.com/KytyPS5/KytyPS5.git
synced 2026-10-21 11:26:56 +02:00
shader: align address-memory buffer bindings
This commit is contained in:
@@ -423,13 +423,13 @@ struct BindingLayout {
|
||||
uint32_t descriptor_set = 0;
|
||||
uint32_t push_constant_offset = 0;
|
||||
uint32_t push_constant_size = 0;
|
||||
uint32_t buffer_offset_dword = 0;
|
||||
uint32_t buffer_offset_count = 0;
|
||||
uint32_t memory_offset_dword = 0;
|
||||
uint32_t memory_offset_count = 0;
|
||||
std::vector<uint32_t> user_data_registers;
|
||||
std::vector<DescriptorBinding> descriptors;
|
||||
|
||||
[[nodiscard]] uint32_t ShaderDataDwords() const {
|
||||
return buffer_offset_dword + (buffer_offset_count + 3u) / 4u;
|
||||
return memory_offset_dword + (memory_offset_count + 3u) / 4u;
|
||||
}
|
||||
|
||||
bool operator==(const BindingLayout& other) const = default;
|
||||
|
||||
@@ -130,8 +130,9 @@ bool AllocateBindings(Program& program, const BindingLayoutOptions& options, std
|
||||
}
|
||||
return false;
|
||||
}
|
||||
next.buffer_offset_dword = static_cast<uint32_t>(next.user_data_registers.size());
|
||||
next.buffer_offset_count = static_cast<uint32_t>(program.info.buffers.size());
|
||||
next.memory_offset_dword = static_cast<uint32_t>(next.user_data_registers.size());
|
||||
next.memory_offset_count =
|
||||
static_cast<uint32_t>(program.info.buffers.size() + program.info.addresses.size());
|
||||
|
||||
if (!program.info.buffers.empty()) {
|
||||
std::vector<uint32_t> resources(program.info.buffers.size());
|
||||
|
||||
Reference in New Issue
Block a user