aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2023-05-05 22:40:46 +0100
committerGitHub <noreply@github.com>2023-05-05 23:40:46 +0200
commit7df4fcada702dbc01d09b8f6fa027f5d409e33e3 (patch)
treed006bc4b9b78d81475a288b6c5ee9dfd7c3f3d33 /src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs
parentd6698680bef4ac37b63d67c5415edf5717a84b3a (diff)
GPU: Remove CPU region handle containers (#4817)1.1.760
* 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
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs
index 14ab5d1e..b36b16e9 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs
@@ -1,10 +1,10 @@
using Ryujinx.Common.Memory;
-using Ryujinx.Cpu.Tracking;
using Ryujinx.Graphics.GAL;
using Ryujinx.Graphics.Gpu.Memory;
using Ryujinx.Graphics.Texture;
using Ryujinx.Memory;
using Ryujinx.Memory.Range;
+using Ryujinx.Memory.Tracking;
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
@@ -255,7 +255,7 @@ namespace Ryujinx.Graphics.Gpu.Image
{
TextureGroupHandle group = _handles[baseHandle + i];
- foreach (CpuRegionHandle handle in group.Handles)
+ foreach (RegionHandle handle in group.Handles)
{
if (handle.Dirty)
{
@@ -296,7 +296,7 @@ namespace Ryujinx.Graphics.Gpu.Image
bool handleDirty = false;
bool handleUnmapped = false;
- foreach (CpuRegionHandle handle in group.Handles)
+ foreach (RegionHandle handle in group.Handles)
{
if (handle.Dirty)
{
@@ -703,7 +703,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <param name="group">The group to register an action for</param>
public void RegisterAction(TextureGroupHandle group)
{
- foreach (CpuRegionHandle handle in group.Handles)
+ foreach (RegionHandle handle in group.Handles)
{
handle.RegisterAction((address, size) => FlushAction(group, address, size));
}
@@ -985,7 +985,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <param name="address">The start address of the tracked region</param>
/// <param name="size">The size of the tracked region</param>
/// <returns>A CpuRegionHandle covering the given range</returns>
- private CpuRegionHandle GenerateHandle(ulong address, ulong size)
+ private RegionHandle GenerateHandle(ulong address, ulong size)
{
return _physicalMemory.BeginTracking(address, size, ResourceKind.Texture);
}
@@ -1005,7 +1005,7 @@ namespace Ryujinx.Graphics.Gpu.Image
int endOffset = _allOffsets[viewEnd] + _sliceSizes[lastLevel];
int size = endOffset - offset;
- var result = new List<CpuRegionHandle>();
+ var result = new List<RegionHandle>();
for (int i = 0; i < TextureRange.Count; i++)
{
@@ -1050,7 +1050,7 @@ namespace Ryujinx.Graphics.Gpu.Image
views,
result.ToArray());
- foreach (CpuRegionHandle handle in result)
+ foreach (RegionHandle handle in result)
{
handle.RegisterDirtyEvent(() => DirtyAction(groupHandle));
}
@@ -1248,7 +1248,7 @@ namespace Ryujinx.Graphics.Gpu.Image
continue;
}
- foreach (CpuRegionHandle handle in groupHandle.Handles)
+ foreach (RegionHandle handle in groupHandle.Handles)
{
bool hasMatch = false;
@@ -1270,7 +1270,7 @@ namespace Ryujinx.Graphics.Gpu.Image
}
else
{
- foreach (CpuRegionHandle handle in groupHandle.Handles)
+ foreach (RegionHandle handle in groupHandle.Handles)
{
handle.Reprotect();
}
@@ -1303,7 +1303,7 @@ namespace Ryujinx.Graphics.Gpu.Image
if (!(_hasMipViews || _hasLayerViews))
{
// Single dirty region.
- var cpuRegionHandles = new CpuRegionHandle[TextureRange.Count];
+ var cpuRegionHandles = new RegionHandle[TextureRange.Count];
int count = 0;
for (int i = 0; i < TextureRange.Count; i++)
@@ -1322,7 +1322,7 @@ namespace Ryujinx.Graphics.Gpu.Image
var groupHandle = new TextureGroupHandle(this, 0, Storage.Size, _views, 0, 0, 0, _allOffsets.Length, cpuRegionHandles);
- foreach (CpuRegionHandle handle in cpuRegionHandles)
+ foreach (RegionHandle handle in cpuRegionHandles)
{
handle.RegisterDirtyEvent(() => DirtyAction(groupHandle));
}