aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs15
1 files changed, 13 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs b/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
index 8df3c8fb..fd2a7476 100644
--- a/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
+++ b/Ryujinx.Graphics.Gpu/Memory/PhysicalMemory.cs
@@ -139,11 +139,22 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// Reads data from the application process.
/// </summary>
/// <typeparam name="T">Type of the structure</typeparam>
- /// <param name="gpuVa">Address to read from</param>
+ /// <param name="address">Address to read from</param>
/// <returns>The data at the specified memory location</returns>
public T Read<T>(ulong address) where T : unmanaged
{
- return MemoryMarshal.Cast<byte, T>(GetSpan(address, Unsafe.SizeOf<T>()))[0];
+ return _cpuMemory.Read<T>(address);
+ }
+
+ /// <summary>
+ /// Reads data from the application process, with write tracking.
+ /// </summary>
+ /// <typeparam name="T">Type of the structure</typeparam>
+ /// <param name="address">Address to read from</param>
+ /// <returns>The data at the specified memory location</returns>
+ public T ReadTracked<T>(ulong address) where T : unmanaged
+ {
+ return _cpuMemory.ReadTracked<T>(address);
}
/// <summary>