aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2024-02-22 02:41:08 +0000
committerGitHub <noreply@github.com>2024-02-21 23:41:08 -0300
commit4f63782baccb530dcf9c5da1a32c6f257e61bc28 (patch)
treebf4c856388f335f02122b2b7cf0d22d8e2981033
parent6f5fcb79706033ca31d83c66041dc266293c2fb5 (diff)
Vulkan: Fix barrier batching past limit (#6339)1.1.1205
If more than 16 barriers were queued at one time, the _queuedBarrierCount would no longer match the number of remaining barriers, because when breaking out of the loop consuming them it deleted all barriers, not just the 16 that were consumed. Should fix freezes that started occurring with #6240. Fixes issue #6338.
-rw-r--r--src/Ryujinx.Graphics.Vulkan/BarrierBatch.cs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/BarrierBatch.cs b/src/Ryujinx.Graphics.Vulkan/BarrierBatch.cs
index 3b44c98c..aa158f03 100644
--- a/src/Ryujinx.Graphics.Vulkan/BarrierBatch.cs
+++ b/src/Ryujinx.Graphics.Vulkan/BarrierBatch.cs
@@ -95,6 +95,7 @@ namespace Ryujinx.Graphics.Vulkan
List<BarrierWithStageFlags<T>> list) where T : unmanaged
{
int firstMatch = -1;
+ int end = list.Count;
for (int i = 0; i < list.Count; i++)
{
@@ -111,6 +112,7 @@ namespace Ryujinx.Graphics.Vulkan
if (count >= target.Length)
{
+ end = i + 1;
break;
}
}
@@ -128,6 +130,7 @@ namespace Ryujinx.Graphics.Vulkan
if (count >= target.Length)
{
+ end = i + 1;
break;
}
}
@@ -146,13 +149,13 @@ namespace Ryujinx.Graphics.Vulkan
}
}
- if (firstMatch == 0)
+ if (firstMatch == 0 && end == list.Count)
{
list.Clear();
}
else if (firstMatch != -1)
{
- int deleteCount = list.Count - firstMatch;
+ int deleteCount = end - firstMatch;
list.RemoveRange(firstMatch, deleteCount);
}