Skip to content

Commit

Permalink
vk: regression: potentially fix various random graphical anomalies
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Jan 6, 2025
1 parent b661bdd commit 845dd9a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Ryujinx.Graphics.Vulkan/BufferMirrorRangeList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,15 @@ public readonly bool OverlapsWith(int offset, int size)
return BinarySearch(list, offset, size) >= 0;
}

public readonly IEnumerable<Range> FindOverlaps(int offset, int size)
public readonly List<Range> FindOverlaps(int offset, int size)
{
var list = _ranges;
if (list == null)
{
yield break;
return null;
}

List<Range> result = null;

int index = BinarySearch(list, offset, size);

Expand All @@ -187,10 +189,12 @@ public readonly IEnumerable<Range> FindOverlaps(int offset, int size)

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<Range> list, int offset, int size)
Expand Down

0 comments on commit 845dd9a

Please sign in to comment.