Spanify Graphics Abstraction Layer (#1226)
* Spanify Graphics Abstraction Layer * Be explicit about BufferHandle size
This commit is contained in:
parent
cc8dbdd3fb
commit
5011640b30
24 changed files with 208 additions and 134 deletions
23
Ryujinx.Graphics.OpenGL/Handle.cs
Normal file
23
Ryujinx.Graphics.OpenGL/Handle.cs
Normal file
|
@ -0,0 +1,23 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue