From c61c1ea8980f0a97ea4d77a5465745d7103e2452 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Thu, 7 Oct 2021 00:00:56 +0100 Subject: Reregister flush actions when taking a buffer's modified range list. Fixes a regression from #2663 where buffer flush would not happen after a resize. Specifically caused the world map in Yoshi's Crafted World to flash. I have other planned changes to this class so this might change soon, but this regression could affect a lot so it couldn't wait. --- Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (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 84cf0dd8..faaccf13 100644 --- a/Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs +++ b/Ryujinx.Graphics.Gpu/Memory/BufferModifiedRangeList.cs @@ -318,6 +318,22 @@ namespace Ryujinx.Graphics.Gpu.Memory } } + /// + /// Calls the given action for modified ranges that aren't from the current sync number. + /// + /// The action to call for each modified range + public void ReregisterRanges(Action rangeAction) + { + ulong currentSync = _context.SyncNumber; + foreach (BufferModifiedRange range in this) + { + if (range.SyncNumber != currentSync) + { + rangeAction(range.Address, range.Size); + } + } + } + private void ClearPart(BufferModifiedRange overlap, ulong address, ulong endAddress) { Remove(overlap); -- cgit v1.2.3