Ryubing/src/Ryujinx.Graphics.GAL/BufferHandle.cs

18 lines
495 B
C#

using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
namespace Ryujinx.Graphics.GAL
{
[StructLayout(LayoutKind.Sequential, Size = 8)]
public readonly record struct BufferHandle
{
private readonly ulong _value;
public static BufferHandle Null => new(0);
private BufferHandle(ulong value) => _value = value;
public static implicit operator int(BufferHandle handle) => (int)Unsafe.As<BufferHandle, ulong>(ref handle);
}
}