aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/Pool.cs4
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/TextureGroup.cs22
-rw-r--r--src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs10
-rw-r--r--src/Ryujinx.Graphics.Gpu/Memory/Buffer.cs7
-rw-r--r--src/Ryujinx.Graphics.Gpu/Memory/GpuRegionHandle.cs7
-rw-r--r--src/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs9
6 files changed, 28 insertions, 31 deletions
diff --git a/src/Ryujinx.Graphics.Gpu/Image/Pool.cs b/src/Ryujinx.Graphics.Gpu/Image/Pool.cs
index 3e557c0b..63be151f 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/Pool.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/Pool.cs
@@ -1,5 +1,5 @@
-using Ryujinx.Cpu.Tracking;
using Ryujinx.Graphics.Gpu.Memory;
+using Ryujinx.Memory.Tracking;
using System;
using System.Runtime.InteropServices;
@@ -40,7 +40,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// </summary>
public ulong Size { get; }
- private readonly CpuMultiRegionHandle _memoryTracking;
+ private readonly MultiRegionHandle _memoryTracking;
private readonly Action<ulong, ulong> _modifiedDelegate;
private int _modifiedSequenceOffset;
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));
}
diff --git a/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs b/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs
index 9f66744b..fd66269d 100644
--- a/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs
+++ b/src/Ryujinx.Graphics.Gpu/Image/TextureGroupHandle.cs
@@ -1,5 +1,5 @@
-using Ryujinx.Cpu.Tracking;
-using Ryujinx.Graphics.Gpu.Synchronization;
+using Ryujinx.Graphics.Gpu.Synchronization;
+using Ryujinx.Memory.Tracking;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -85,7 +85,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <summary>
/// The CPU memory tracking handles that cover this handle.
/// </summary>
- public CpuRegionHandle[] Handles { get; }
+ public RegionHandle[] Handles { get; }
/// <summary>
/// True if a texture overlapping this handle has been modified. Is set false when the flush action is called.
@@ -127,7 +127,7 @@ namespace Ryujinx.Graphics.Gpu.Image
int firstLevel,
int baseSlice,
int sliceCount,
- CpuRegionHandle[] handles)
+ RegionHandle[] handles)
{
_group = group;
_firstLayer = firstLayer;
@@ -642,7 +642,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// </summary>
public void Dispose()
{
- foreach (CpuRegionHandle handle in Handles)
+ foreach (RegionHandle handle in Handles)
{
handle.Dispose();
}
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
/// </remarks>
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<ulong, ulong> _loadDelegate;
@@ -102,7 +101,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
}
else
{
- return Enumerable.Repeat(buffer._memoryTracking.GetHandle(), 1);
+ return Enumerable.Repeat(buffer._memoryTracking, 1);
}
});
}
diff --git a/src/Ryujinx.Graphics.Gpu/Memory/GpuRegionHandle.cs b/src/Ryujinx.Graphics.Gpu/Memory/GpuRegionHandle.cs
index bc07bfad..9f73de4e 100644
--- a/src/Ryujinx.Graphics.Gpu/Memory/GpuRegionHandle.cs
+++ b/src/Ryujinx.Graphics.Gpu/Memory/GpuRegionHandle.cs
@@ -1,5 +1,4 @@
-using Ryujinx.Cpu.Tracking;
-using Ryujinx.Memory.Tracking;
+using Ryujinx.Memory.Tracking;
using System;
namespace Ryujinx.Graphics.Gpu.Memory
@@ -9,7 +8,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// </summary>
class GpuRegionHandle : IRegionHandle
{
- private readonly CpuRegionHandle[] _cpuRegionHandles;
+ private readonly RegionHandle[] _cpuRegionHandles;
public bool Dirty
{
@@ -35,7 +34,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// Create a new GpuRegionHandle, made up of mulitple CpuRegionHandles.
/// </summary>
/// <param name="cpuRegionHandles">The CpuRegionHandles that make up this handle</param>
- public GpuRegionHandle(CpuRegionHandle[] cpuRegionHandles)
+ public GpuRegionHandle(RegionHandle[] cpuRegionHandles)
{
_cpuRegionHandles = cpuRegionHandles;
}
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
/// <param name="size">Size of the region</param>
/// <param name="kind">Kind of the resource being tracked</param>
/// <returns>The memory tracking handle</returns>
- 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
/// <returns>The memory tracking handle</returns>
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
/// <param name="handles">Handles to inherit state from or reuse</param>
/// <param name="granularity">Desired granularity of write tracking</param>
/// <returns>The memory tracking handle</returns>
- public CpuMultiRegionHandle BeginGranularTracking(ulong address, ulong size, ResourceKind kind, IEnumerable<IRegionHandle> handles = null, ulong granularity = 4096)
+ public MultiRegionHandle BeginGranularTracking(ulong address, ulong size, ResourceKind kind, IEnumerable<IRegionHandle> handles = null, ulong granularity = 4096)
{
return _cpuMemory.BeginGranularTracking(address, size, handles, granularity, (int)kind);
}
@@ -403,7 +402,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <param name="kind">Kind of the resource being tracked</param>
/// <param name="granularity">Desired granularity of write tracking</param>
/// <returns>The memory tracking handle</returns>
- 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);
}