mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-27 04:25:12 +00:00
More precise buffer size calculation
This commit is contained in:
parent
5f447a815e
commit
84667cf4a9
@ -80,7 +80,15 @@ struct Buffer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
u32 GetSize() const noexcept {
|
u32 GetSize() const noexcept {
|
||||||
return stride == 0 ? num_records : (stride * num_records);
|
if (stride == 0) {
|
||||||
|
return num_records;
|
||||||
|
}
|
||||||
|
auto bits = NumBits(DataFormat(data_format));
|
||||||
|
if (bits <= 0) {
|
||||||
|
return stride * num_records;
|
||||||
|
}
|
||||||
|
auto dfmt_bytes = bits / 8;
|
||||||
|
return stride * (num_records - 1) + dfmt_bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 GetIndexStride() const noexcept {
|
u32 GetIndexStride() const noexcept {
|
||||||
|
Loading…
Reference in New Issue
Block a user