mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-15 09:35:27 +00:00
Support use of buffer ranges with size 0 (#3736)
This commit is contained in:
parent
5437d6cb13
commit
a4fc9f8050
|
@ -24,6 +24,11 @@
|
||||||
|
|
||||||
public void Add(int cbIndex, int offset, int size)
|
public void Add(int cbIndex, int offset, int size)
|
||||||
{
|
{
|
||||||
|
if (size == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Some usages can be out of bounds (vertex buffer on amd), so bound if necessary.
|
// Some usages can be out of bounds (vertex buffer on amd), so bound if necessary.
|
||||||
if (offset + size > _size)
|
if (offset + size > _size)
|
||||||
{
|
{
|
||||||
|
@ -39,6 +44,11 @@
|
||||||
|
|
||||||
public bool OverlapsWith(int cbIndex, int offset, int size)
|
public bool OverlapsWith(int cbIndex, int offset, int size)
|
||||||
{
|
{
|
||||||
|
if (size == 0)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
int cbBase = cbIndex * _bitsPerCb;
|
int cbBase = cbIndex * _bitsPerCb;
|
||||||
int start = cbBase + offset / _granularity;
|
int start = cbBase + offset / _granularity;
|
||||||
int end = cbBase + (offset + size - 1) / _granularity;
|
int end = cbBase + (offset + size - 1) / _granularity;
|
||||||
|
|
Loading…
Reference in a new issue