From 7379bc2f39557929f283a423fe7f4b7390d08261 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Sun, 19 Sep 2021 13:22:26 +0100 Subject: Array based RangeList that caches Address/EndAddress (#2642) * Array based RangeList that caches Address/EndAddress In isolation, this was more than 2x faster than the RangeList that checks using the interface. In practice I'm seeing much better results than I expected. The array is used because checking it is slightly faster than using a list, which loses time to struct copies, but I still want that data locality. A method has been added to the list to update the cached end address, as some users of the RangeList currently modify it dynamically. Greatly improves performance in Super Mario Odyssey, Xenoblade and any other GPU limited games. * Address Feedback --- Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs') diff --git a/Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs b/Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs index 9e5c5e84..63227431 100644 --- a/Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs +++ b/Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs @@ -365,7 +365,7 @@ namespace Ryujinx.Graphics.Gpu.Memory { lock (_lock) { - Items.Clear(); + Count = 0; } } } -- cgit v1.2.3