2023-12-04 08:17:13 -05:00
|
|
|
using Ryujinx.Graphics.GAL;
|
2020-05-23 05:46:09 -04:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|