shader_recompiler: Improvements to buffer addressing implementation. (#2123)

This commit is contained in:
squidbus 2025-01-16 18:40:03 -08:00 committed by GitHub
parent eb49193309
commit 3b474a12f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 149 additions and 83 deletions

View file

@ -76,6 +76,16 @@ struct Buffer {
u32 GetSize() const noexcept {
return stride == 0 ? num_records : (stride * num_records);
}
u32 GetIndexStride() const noexcept {
// Index stride is 2 bits, meaning 8, 16, 32, or 64.
return 8 << index_stride;
}
u32 GetElementSize() const noexcept {
// Element size is 2 bits, meaning 2, 4, 8, or 16.
return 2 << element_size;
}
};
static_assert(sizeof(Buffer) == 16); // 128bits