0
0
Fork 0
This repository has been archived on 2024-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ryujinx-final/Ryujinx.Graphics.OpenGL/Handle.cs
gdkchan 5011640b30
Spanify Graphics Abstraction Layer (#1226)
* Spanify Graphics Abstraction Layer

* Be explicit about BufferHandle size
2020-05-23 11:46:09 +02:00

23 lines
571 B
C#

using Ryujinx.Graphics.GAL;
using System.Diagnostics;
using System.Runtime.CompilerServices;
namespace Ryujinx.Graphics.OpenGL
{
static class Handle
{
public static T FromInt32<T>(int handle) where T : unmanaged
{
Debug.Assert(Unsafe.SizeOf<T>() == sizeof(ulong));
ulong handle64 = (uint)handle;
return Unsafe.As<ulong, T>(ref handle64);
}
public static int ToInt32(this BufferHandle handle)
{
return (int)Unsafe.As<BufferHandle, ulong>(ref handle);
}
}
}