0
0
Fork 0
mirror of https://github.com/GreemDev/Ryujinx.git synced 2025-01-11 13:22:01 +00:00
Ryujinx/src/Ryujinx.Graphics.Nvdec/MemoryExtensions.cs
TSRBerry 2989c163a8
editorconfig: Set default encoding to UTF-8 (#5793)
* editorconfig: Add default charset

* Change file encoding from UTF-8-BOM to UTF-8
2023-12-04 14:17:13 +01:00

28 lines
766 B
C#

using Ryujinx.Graphics.Gpu.Memory;
using System;
namespace Ryujinx.Graphics.Nvdec
{
static class MemoryExtensions
{
public static T DeviceRead<T>(this MemoryManager gmm, uint offset) where T : unmanaged
{
return gmm.Read<T>((ulong)offset << 8);
}
public static ReadOnlySpan<byte> DeviceGetSpan(this MemoryManager gmm, uint offset, int size)
{
return gmm.GetSpan((ulong)offset << 8, size);
}
public static void DeviceWrite(this MemoryManager gmm, uint offset, ReadOnlySpan<byte> data)
{
gmm.Write((ulong)offset << 8, data);
}
public static ulong ExtendOffset(uint offset)
{
return (ulong)offset << 8;
}
}
}