From 845dd9a8db4d988f4b2c58dd905f25146c988b6d Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Sun, 5 Jan 2025 22:25:05 -0600 Subject: [PATCH] vk: regression: potentially fix various random graphical anomalies --- src/Ryujinx.Graphics.Vulkan/BufferMirrorRangeList.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx.Graphics.Vulkan/BufferMirrorRangeList.cs b/src/Ryujinx.Graphics.Vulkan/BufferMirrorRangeList.cs index e79248a47..f7f78b613 100644 --- a/src/Ryujinx.Graphics.Vulkan/BufferMirrorRangeList.cs +++ b/src/Ryujinx.Graphics.Vulkan/BufferMirrorRangeList.cs @@ -168,13 +168,15 @@ namespace Ryujinx.Graphics.Vulkan return BinarySearch(list, offset, size) >= 0; } - public readonly IEnumerable FindOverlaps(int offset, int size) + public readonly List FindOverlaps(int offset, int size) { var list = _ranges; if (list == null) { - yield break; + return null; } + + List result = null; int index = BinarySearch(list, offset, size); @@ -187,10 +189,12 @@ namespace Ryujinx.Graphics.Vulkan do { - yield return list[index++]; + (result ??= []).Add(list[index++]); } while (index < list.Count && list[index].OverlapsWith(offset, size)); } + + return result; } private static int BinarySearch(List list, int offset, int size)