From 7df4fcada702dbc01d09b8f6fa027f5d409e33e3 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Fri, 5 May 2023 22:40:46 +0100 Subject: GPU: Remove CPU region handle containers (#4817) * GPU: Remove CPU region handle containers. Another one for the "I don't know why I didn't do this earlier" pile. This removes the "Cpu" prefixed region handle classes, which each mirror a region handle type from Ryujinx.Memory. Originally, not all projects had a reference to Ryujinx.Memory, so these classes were introduced to bridge the gap. Someone else crossed that bridge since, so these classes don't have much of a purpose anymore. This PR replaces all uses of CpuRegionHandle etc to their direct Ryujinx.Memory versions. RegionHandle methods (specifically QueryModified) are about the hottest path there is in the entire emulator, so there is a nice boost from doing this. * Add docs --- src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs') diff --git a/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs b/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs index 8e16b3ae..dc5037c5 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs @@ -1,4 +1,3 @@ -using Ryujinx.Cpu.Tracking; using Ryujinx.Graphics.GAL; using Ryujinx.Graphics.Gpu.Synchronization; using Ryujinx.Memory.Range; @@ -54,8 +53,8 @@ namespace Ryujinx.Graphics.Gpu.Memory /// private BufferModifiedRangeList _modifiedRanges = null; - private readonly CpuMultiRegionHandle _memoryTrackingGranular; - private readonly CpuRegionHandle _memoryTracking; + private readonly MultiRegionHandle _memoryTrackingGranular; + private readonly RegionHandle _memoryTracking; private readonly RegionSignal _externalFlushDelegate; private readonly Action _loadDelegate; @@ -102,7 +101,7 @@ namespace Ryujinx.Graphics.Gpu.Memory } else { - return Enumerable.Repeat(buffer._memoryTracking.GetHandle(), 1); + return Enumerable.Repeat(buffer._memoryTracking, 1); } }); } -- cgit v1.2.3