From 12a7a2ead812d46deb9d978b6758731157be1cbc Mon Sep 17 00:00:00 2001 From: riperiperi Date: Thu, 24 Jun 2021 00:31:26 +0100 Subject: Inherit buffer tracking handles rather than recreating on resize (#2330) This greatly speeds up games that constantly resize buffers, and removes stuttering on games that resize large buffers occasionally: - Large improvement on Super Mario 3D All-Stars (#1663 needed for best performance) - Improvement to Hyrule Warriors: AoC, and UE4 games. These games can still stutter due to texture creation/loading. - Small improvement to other games, potential 1-frame stutters avoided. `ForceSynchronizeMemory`, which was added with POWER, is no longer needed. Some tests have been added for the MultiRegionHandle. --- Ryujinx.Memory/Tracking/MemoryTracking.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Ryujinx.Memory/Tracking/MemoryTracking.cs') diff --git a/Ryujinx.Memory/Tracking/MemoryTracking.cs b/Ryujinx.Memory/Tracking/MemoryTracking.cs index 70951e8c..aafb418d 100644 --- a/Ryujinx.Memory/Tracking/MemoryTracking.cs +++ b/Ryujinx.Memory/Tracking/MemoryTracking.cs @@ -134,13 +134,14 @@ namespace Ryujinx.Memory.Tracking /// /// CPU virtual address of the region /// Size of the region + /// Handles to inherit state from or reuse. When none are present, provide null /// Desired granularity of write tracking /// The memory tracking handle - public MultiRegionHandle BeginGranularTracking(ulong address, ulong size, ulong granularity) + public MultiRegionHandle BeginGranularTracking(ulong address, ulong size, IEnumerable handles, ulong granularity) { (address, size) = PageAlign(address, size); - return new MultiRegionHandle(this, address, size, granularity); + return new MultiRegionHandle(this, address, size, handles, granularity); } /// -- cgit v1.2.3