Refactor PipelineUid and pack TopologyClass
Remove basepipelineindex as its extraneous
This commit is contained in:
parent
59ef2ac799
commit
3b398adbe6
2 changed files with 195 additions and 266 deletions
|
@ -11,20 +11,14 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
{
|
||||
public ulong Id0;
|
||||
public ulong Id1;
|
||||
|
||||
public ulong Id2;
|
||||
public ulong Id3;
|
||||
|
||||
public ulong Id4;
|
||||
public ulong Id5;
|
||||
public ulong Id6;
|
||||
|
||||
public ulong Id7;
|
||||
public ulong Id8;
|
||||
|
||||
private readonly uint VertexAttributeDescriptionsCount => (byte)((Id5 >> 38) & 0xFF);
|
||||
private readonly uint VertexBindingDescriptionsCount => (byte)((Id5 >> 46) & 0xFF);
|
||||
private readonly uint ColorBlendAttachmentStateCount => (byte)((Id6 >> 8) & 0xFF);
|
||||
private readonly bool HasDepthStencil => ((Id6 >> 63) & 0x1) != 0UL;
|
||||
private readonly uint VertexAttributeDescriptionsCount => (byte)((Id0 >> 38) & 0xFF);
|
||||
private readonly uint VertexBindingDescriptionsCount => (byte)((Id0 >> 46) & 0xFF);
|
||||
private readonly uint ColorBlendAttachmentStateCount => (byte)((Id1 >> 8) & 0xFF);
|
||||
private readonly bool HasDepthStencil => ((Id1 >> 63) & 0x1) != 0UL;
|
||||
|
||||
public Array32<VertexInputAttributeDescription> VertexAttributeDescriptions;
|
||||
public Array33<VertexInputBindingDescription> VertexBindingDescriptions;
|
||||
|
@ -40,9 +34,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
public bool Equals(ref PipelineUid other)
|
||||
{
|
||||
if (!Unsafe.As<ulong, Vector256<byte>>(ref Id0).Equals(Unsafe.As<ulong, Vector256<byte>>(ref other.Id0)) ||
|
||||
!Unsafe.As<ulong, Vector256<byte>>(ref Id4).Equals(Unsafe.As<ulong, Vector256<byte>>(ref other.Id4)) ||
|
||||
!Unsafe.As<ulong, Vector128<byte>>(ref Id7).Equals(Unsafe.As<ulong, Vector128<byte>>(ref other.Id7)))
|
||||
if (!Unsafe.As<ulong, Vector128<byte>>(ref Id2).Equals(Unsafe.As<ulong, Vector128<byte>>(ref other.Id2)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -80,12 +72,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
ulong hash64 = Id0 * 23 ^
|
||||
Id1 * 23 ^
|
||||
Id2 * 23 ^
|
||||
Id3 * 23 ^
|
||||
Id4 * 23 ^
|
||||
Id5 * 23 ^
|
||||
Id6 * 23 ^
|
||||
Id7 * 23 ^
|
||||
Id8 * 23;
|
||||
Id3 * 23;
|
||||
|
||||
for (int i = 0; i < (int)VertexAttributeDescriptionsCount; i++)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue