mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-12 13:43:15 +00:00
shader_recompiler: Improvements to buffer addressing implementation. (#2123)
This commit is contained in:
parent
eb49193309
commit
3b474a12f9
5 changed files with 149 additions and 83 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue