aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs22
1 files changed, 21 insertions, 1 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs b/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs
index 52cc8ee0..3e35f8d2 100644
--- a/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs
+++ b/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs
@@ -1,3 +1,4 @@
+using System;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
@@ -6,7 +7,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <summary>
/// Maxwell texture descriptor, as stored on the GPU texture pool memory region.
/// </summary>
- struct TextureDescriptor : ITextureDescriptor
+ struct TextureDescriptor : ITextureDescriptor, IEquatable<TextureDescriptor>
{
#pragma warning disable CS0649
public uint Word0;
@@ -249,5 +250,24 @@ namespace Ryujinx.Graphics.Gpu.Image
{
return Unsafe.As<TextureDescriptor, Vector256<byte>>(ref this).Equals(Unsafe.As<TextureDescriptor, Vector256<byte>>(ref other));
}
+
+ /// <summary>
+ /// Check if two descriptors are equal.
+ /// </summary>
+ /// <param name="other">The descriptor to compare against</param>
+ /// <returns>True if they are equal, false otherwise</returns>
+ public bool Equals(TextureDescriptor other)
+ {
+ return Equals(ref other);
+ }
+
+ /// <summary>
+ /// Gets a hash code for this descriptor.
+ /// </summary>
+ /// <returns>The hash code for this descriptor.</returns>
+ public override int GetHashCode()
+ {
+ return Unsafe.As<TextureDescriptor, Vector256<byte>>(ref this).GetHashCode();
+ }
}
}