diff options
| author | riperiperi <rhy3756547@hotmail.com> | 2021-01-29 03:19:06 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-29 14:19:06 +1100 |
| commit | c30504e3b3bb64c44d993d6339f15ec6703a3c55 (patch) | |
| tree | 91be94fc94dd52dcb8972f745559cf66f9dccb22 /Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs | |
| parent | 9eb0ab05c6e820e113b3c61cbacd9b085b2819c4 (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/TextureDescriptor.cs')
| -rw-r--r-- | Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs b/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs index 76d97bf8..e85df136 100644 --- a/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs +++ b/Ryujinx.Graphics.Gpu/Image/TextureDescriptor.cs @@ -1,4 +1,6 @@ using Ryujinx.Graphics.Gpu.Shader.Cache.Definition; +using System.Runtime.CompilerServices; +using System.Runtime.Intrinsics; namespace Ryujinx.Graphics.Gpu.Image { @@ -248,5 +250,15 @@ namespace Ryujinx.Graphics.Gpu.Image return result; } + + /// <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 TextureDescriptor other) + { + return Unsafe.As<TextureDescriptor, Vector256<byte>>(ref this).Equals(Unsafe.As<TextureDescriptor, Vector256<byte>>(ref other)); + } } } |
