mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2024-12-19 05:15:55 +01:00
2989c163a8
* editorconfig: Add default charset * Change file encoding from UTF-8-BOM to UTF-8
24 lines
568 B
C#
24 lines
568 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);
|
|
}
|
|
}
|
|
}
|