From c30504e3b3bb64c44d993d6339f15ec6703a3c55 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Fri, 29 Jan 2021 03:19:06 +0000 Subject: 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 --- Ryujinx.Graphics.Gpu/Image/SamplerDescriptor.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Ryujinx.Graphics.Gpu/Image/SamplerDescriptor.cs') 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; } + + /// + /// Check if two descriptors are equal. + /// + /// The descriptor to compare against + /// True if they are equal, false otherwise + public bool Equals(ref SamplerDescriptor other) + { + return Unsafe.As>(ref this).Equals(Unsafe.As>(ref other)); + } } } -- cgit v1.2.3