aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2020-05-27 11:07:10 -0300
committerGitHub <noreply@github.com>2020-05-27 16:07:10 +0200
commit5795bb15282498b3824a5d15fe1ff78b85a18c23 (patch)
tree6d4ee54c218e81fc6efaad279a5b1ade3ca8ec59 /Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs
parent0b6d206daad7202d4e271118b631feb7dd363bbc (diff)
Support separate textures and samplers (#1216)
* Support separate textures and samplers * Add missing bindless flag, fix SNORM format on buffer textures * Add missing separation * Add comments about the new handles
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs b/Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs
index cfc6f7f5..38f448d9 100644
--- a/Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs
+++ b/Ryujinx.Graphics.Gpu/Memory/MemoryAccessor.cs
@@ -46,11 +46,11 @@ namespace Ryujinx.Graphics.Gpu.Memory
}
/// <summary>
- /// Reads a structure from GPU mapped memory.
+ /// Reads data from GPU mapped memory.
/// </summary>
- /// <typeparam name="T">Type of the structure</typeparam>
- /// <param name="gpuVa">GPU virtual address where the structure is located</param>
- /// <returns>The structure at the specified memory location</returns>
+ /// <typeparam name="T">Type of the data</typeparam>
+ /// <param name="gpuVa">GPU virtual address where the data is located</param>
+ /// <returns>The data at the specified memory location</returns>
public T Read<T>(ulong gpuVa) where T : unmanaged
{
ulong processVa = _context.MemoryManager.Translate(gpuVa);
@@ -67,7 +67,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
{
ulong processVa = _context.MemoryManager.Translate(gpuVa);
- return BitConverter.ToInt32(_context.PhysicalMemory.GetSpan(processVa, 4));
+ return _context.PhysicalMemory.Read<int>(processVa);
}
/// <summary>
@@ -79,7 +79,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
{
ulong processVa = _context.MemoryManager.Translate(gpuVa);
- return BitConverter.ToUInt64(_context.PhysicalMemory.GetSpan(processVa, 8));
+ return _context.PhysicalMemory.Read<ulong>(processVa);
}
/// <summary>