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/PhysicalMemory.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs') diff --git a/src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs b/src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs index b976667c..364488aa 100644 --- a/src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs +++ b/src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs @@ -1,5 +1,4 @@ using Ryujinx.Cpu; -using Ryujinx.Cpu.Tracking; using Ryujinx.Graphics.Gpu.Image; using Ryujinx.Graphics.Gpu.Shader; using Ryujinx.Memory; @@ -348,7 +347,7 @@ namespace Ryujinx.Graphics.Gpu.Memory /// Size of the region /// Kind of the resource being tracked /// The memory tracking handle - public CpuRegionHandle BeginTracking(ulong address, ulong size, ResourceKind kind) + public RegionHandle BeginTracking(ulong address, ulong size, ResourceKind kind) { return _cpuMemory.BeginTracking(address, size, (int)kind); } @@ -361,7 +360,7 @@ namespace Ryujinx.Graphics.Gpu.Memory /// The memory tracking handle public GpuRegionHandle BeginTracking(MultiRange range, ResourceKind kind) { - var cpuRegionHandles = new CpuRegionHandle[range.Count]; + var cpuRegionHandles = new RegionHandle[range.Count]; int count = 0; for (int i = 0; i < range.Count; i++) @@ -390,7 +389,7 @@ namespace Ryujinx.Graphics.Gpu.Memory /// Handles to inherit state from or reuse /// Desired granularity of write tracking /// The memory tracking handle - public CpuMultiRegionHandle BeginGranularTracking(ulong address, ulong size, ResourceKind kind, IEnumerable handles = null, ulong granularity = 4096) + public MultiRegionHandle BeginGranularTracking(ulong address, ulong size, ResourceKind kind, IEnumerable handles = null, ulong granularity = 4096) { return _cpuMemory.BeginGranularTracking(address, size, handles, granularity, (int)kind); } @@ -403,7 +402,7 @@ namespace Ryujinx.Graphics.Gpu.Memory /// Kind of the resource being tracked /// Desired granularity of write tracking /// The memory tracking handle - public CpuSmartMultiRegionHandle BeginSmartGranularTracking(ulong address, ulong size, ResourceKind kind, ulong granularity = 4096) + public SmartMultiRegionHandle BeginSmartGranularTracking(ulong address, ulong size, ResourceKind kind, ulong granularity = 4096) { return _cpuMemory.BeginSmartGranularTracking(address, size, granularity, (int)kind); } -- cgit v1.2.3