mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-12-10 13:48:40 +00:00
shader_recompiler: Improvements to buffer addressing implementation. (#2123)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user