mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-11-15 01:25:25 +00:00
5011640b30
* Spanify Graphics Abstraction Layer * Be explicit about BufferHandle size
23 lines
869 B
C#
23 lines
869 B
C#
using System;
|
|
using System.Diagnostics.CodeAnalysis;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Ryujinx.Graphics.GAL
|
|
{
|
|
[StructLayout(LayoutKind.Sequential, Size = 8)]
|
|
public struct BufferHandle : IEquatable<BufferHandle>
|
|
{
|
|
private readonly ulong _value;
|
|
|
|
public static BufferHandle Null => new BufferHandle(0);
|
|
|
|
private BufferHandle(ulong value) => _value = value;
|
|
|
|
public override bool Equals(object obj) => obj is BufferHandle handle && Equals(handle);
|
|
public bool Equals([AllowNull] BufferHandle other) => other._value == _value;
|
|
public override int GetHashCode() => _value.GetHashCode();
|
|
public static bool operator ==(BufferHandle left, BufferHandle right) => left.Equals(right);
|
|
public static bool operator !=(BufferHandle left, BufferHandle right) => !(left == right);
|
|
}
|
|
}
|