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
This commit is contained in:
riperiperi 2021-01-29 03:19:06 +00:00 committed by GitHub
parent 9eb0ab05c6
commit c30504e3b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 60 additions and 22 deletions

View file

@ -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));
}
}
}