aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Gpu/Image/SamplerDescriptor.cs
diff options
context:
space:
mode:
authorriperiperi <rhy3756547@hotmail.com>2021-01-29 03:19:06 +0000
committerGitHub <noreply@github.com>2021-01-29 14:19:06 +1100
commitc30504e3b3bb64c44d993d6339f15ec6703a3c55 (patch)
tree91be94fc94dd52dcb8972f745559cf66f9dccb22 /Ryujinx.Graphics.Gpu/Image/SamplerDescriptor.cs
parent9eb0ab05c6e820e113b3c61cbacd9b085b2819c4 (diff)
Use a descriptor cache for faster pool invalidation. (#1977)
* Use a descriptor cache for faster pool invalidation. * Speed up comparison by casting to Vector256 Now we never need to worry about this ever again
Diffstat (limited to 'Ryujinx.Graphics.Gpu/Image/SamplerDescriptor.cs')
-rw-r--r--Ryujinx.Graphics.Gpu/Image/SamplerDescriptor.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/SamplerDescriptor.cs b/Ryujinx.Graphics.Gpu/Image/SamplerDescriptor.cs
index 2c28b743..64a146fb 100644
--- a/Ryujinx.Graphics.Gpu/Image/SamplerDescriptor.cs
+++ b/Ryujinx.Graphics.Gpu/Image/SamplerDescriptor.cs
@@ -1,4 +1,6 @@
using Ryujinx.Graphics.GAL;
+using System.Runtime.CompilerServices;
+using System.Runtime.Intrinsics;
namespace Ryujinx.Graphics.Gpu.Image
{
@@ -244,5 +246,15 @@ namespace Ryujinx.Graphics.Gpu.Image
{
return ((Word2 >> 12) & 0xfff) * Frac8ToF32;
}
+
+ /// <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(ref SamplerDescriptor other)
+ {
+ return Unsafe.As<SamplerDescriptor, Vector256<byte>>(ref this).Equals(Unsafe.As<SamplerDescriptor, Vector256<byte>>(ref other));
+ }
}
}