aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2022-10-03 20:08:38 -0300
committerGitHub <noreply@github.com>2022-10-03 20:08:38 -0300
commita4fc9f8050405c8589793d93caa8f259d1618708 (patch)
tree88d055e952f273d77f68b91ea62acd92bcd45d5a
parent5437d6cb13a1487e4ab7cfd64c8b66ed7f9e8c81 (diff)
Support use of buffer ranges with size 0 (#3736)
-rw-r--r--Ryujinx.Graphics.Vulkan/BufferUsageBitmap.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Vulkan/BufferUsageBitmap.cs b/Ryujinx.Graphics.Vulkan/BufferUsageBitmap.cs
index 3242b9fc..920501d3 100644
--- a/Ryujinx.Graphics.Vulkan/BufferUsageBitmap.cs
+++ b/Ryujinx.Graphics.Vulkan/BufferUsageBitmap.cs
@@ -24,6 +24,11 @@
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.
if (offset + size > _size)
{
@@ -39,6 +44,11 @@
public bool OverlapsWith(int cbIndex, int offset, int size)
{
+ if (size == 0)
+ {
+ return false;
+ }
+
int cbBase = cbIndex * _bitsPerCb;
int start = cbBase + offset / _granularity;
int end = cbBase + (offset + size - 1) / _granularity;