Using the Meta branch of UE5.1.1 and trying to get PSO caching to work.
I can generate the files on the Quest 2, copy them over, but when I try and expand them all of the shaders from the project (except the pre-made Niagara ones) get discarded.
I edited the engine code so that I could see what is happening; it seems like the invertibility check creates a shader object, uses that object to create a string version of it, and then creates a dummy from that string that it compares to the first.
If I look at the strings that are generated, I notice there is a 16 in the dummy one that is not present in the original.
Since it throws them all out, I still get a lot of hitches in game and I’m not sure what to do.
Is there a bug related to creating or checking the PSO entries?
[2023.04.23-03.00.22:946][ 0]LogShaderPipelineCacheTools: Warning: Bad PSO found discarding [Invertibility=FAIL Verify=PASS in: C:\p4v\PDTAMR\PDTAMR\PSOCache/++UE5+Release-5.1-CL-0-PDTAMR_SF_VULKAN_ES31_ANDROID_21986BFD69C444C98A988C156D7F1506.rec.upipelinecache]
[2023.04.23-03.00.22:946][ 0]LogShaderPipelineCacheTools: Warning: Bad PSO found discarding [Invertibility=FAIL Verify=PASS in: C:\p4v\PDTAMR\PDTAMR\PSOCache/++UE5+Release-5.1-CL-0-PDTAMR_SF_VULKAN_ES31_ANDROID_21986BFD69C444C98A988C156D7F1506.rec.upipelinecache]
[2023.04.23-03.00.22:946][ 0]LogShaderPipelineCacheTools: Warning: Bad PSO found discarding [Invertibility=FAIL Verify=PASS in: C:\p4v\PDTAMR\PDTAMR\PSOCache/++UE5+Release-5.1-CL-0-PDTAMR_SF_VULKAN_ES31_ANDROID_21986BFD69C444C98A988C156D7F1506.rec.upipelinecache]
[2023.04.23-03.00.22:946][ 0]LogShaderPipelineCacheTools: Warning: Bad PSO found discarding [Invertibility=FAIL Verify=PASS in: C:\p4v\PDTAMR\PDTAMR\PSOCache/++UE5+Release-5.1-CL-0-PDTAMR_SF_VULKAN_ES31_ANDROID_21986BFD69C444C98A988C156D7F1506.rec.upipelinecache]
[2023.04.23-03.00.22:946][ 0]LogShaderPipelineCacheTools: Warning: Bad PSO found discarding [Invertibility=FAIL Verify=PASS in: C:\p4v\PDTAMR\PDTAMR\PSOCache/++UE5+Release-5.1-CL-0-PDTAMR_SF_VULKAN_ES31_ANDROID_21986BFD69C444C98A988C156D7F1506.rec.upipelinecache]
[2023.04.23-03.00.22:946][ 0]LogShaderPipelineCacheTools: Warning: Bad PSO found discarding [Invertibility=FAIL Verify=PASS in: C:\p4v\PDTAMR\PDTAMR\PSOCache/++UE5+Release-5.1-CL-0-PDTAMR_SF_VULKAN_ES31_ANDROID_21986BFD69C444C98A988C156D7F1506.rec.upipelinecache]
[2023.04.23-03.00.22:946][ 0]LogShaderPipelineCacheTools: Warning: Bad PSO found discarding [Invertibility=FAIL Verify=PASS in: C:\p4v\PDTAMR\PDTAMR\PSOCache/++UE5+Release-5.1-CL-0-PDTAMR_SF_VULKAN_ES31_ANDROID_21986BFD69C444C98A988C156D7F1506.rec.upipelinecache]
[2023.04.23-03.00.22:946][ 0]LogShaderPipelineCacheTools: Warning: Bad PSO found discarding [Invertibility=FAIL Verify=PASS in: C:\p4v\PDTAMR\PDTAMR\PSOCache/++UE5+Release-5.1-CL-0-PDTAMR_SF_VULKAN_ES31_ANDROID_21986BFD69C444C98A988C156D7F1506.rec.upipelinecache]
[2023.04.23-03.00.22:946][ 0]LogShaderPipelineCacheTools: Warning: Bad PSO found discarding [Invertibility=FAIL Verify=PASS in: C:\p4v\PDTAMR\PDTAMR\PSOCache/++UE5+Release-5.1-CL-0-PDTAMR_SF_VULKAN_ES31_ANDROID_21986BFD69C444C98A988C156D7F1506.rec.upipelinecache]
[2023.04.23-03.00.22:946][ 0]LogShaderPipelineCacheTools: Warning: Bad PSO found discarding [Invertibility=FAIL Verify=PASS in: C:\p4v\PDTAMR\PDTAMR\PSOCache/++UE5+Release-5.1-CL-0-PDTAMR_SF_VULKAN_ES31_ANDROID_21986BFD69C444C98A988C156D7F1506.rec.upipelinecache]
[2023.04.23-03.00.22:946][ 0]LogShaderPipelineCacheTools: Warning: Bad PSO found discarding [Invertibility=FAIL Verify=PASS in: C:\p4v\PDTAMR\PDTAMR\PSOCache/++UE5+Release-5.1-CL-0-PDTAMR_SF_VULKAN_ES31_ANDROID_21986BFD69C444C98A988C156D7F1506.rec.upipelinecache]
[2023.04.23-03.00.22:946][ 0]LogShaderPipelineCacheTools: Warning: Bad PSO found discarding [Invertibility=FAIL Verify=PASS in: C:\p4v\PDTAMR\PDTAMR\PSOCache/++UE5+Release-5.1-CL-0-PDTAMR_SF_VULKAN_ES31_ANDROID_21986BFD69C444C98A988C156D7F1506.rec.upipelinecache]
I modified the invertibility check to be able to see the string difference:
bool CheckPSOStringInveribility(const FPipelineCacheFileFormatPSO& Item)
{
FPipelineCacheFileFormatPSO TempItem(Item);
TempItem.Hash = 0;
FString StringRep;
switch (Item.Type)
{
case FPipelineCacheFileFormatPSO::DescriptorType::Compute:
StringRep = TempItem.ComputeDesc.ToString();
break;
case FPipelineCacheFileFormatPSO::DescriptorType::Graphics:
StringRep = TempItem.GraphicsDesc.ToString();
break;
case FPipelineCacheFileFormatPSO::DescriptorType::RayTracing:
StringRep = TempItem.RayTracingDesc.ToString();
break;
default:
return false;
}
FPipelineCacheFileFormatPSO DupItem;
FMemory::Memzero(DupItem.GraphicsDesc);
DupItem.Type = Item.Type;
DupItem.UsageMask = Item.UsageMask;
FString Temp;
switch (Item.Type)
{
case FPipelineCacheFileFormatPSO::DescriptorType::Compute:
DupItem.ComputeDesc.FromString(StringRep);
Temp = DupItem.ComputeDesc.ToString();
break;
case FPipelineCacheFileFormatPSO::DescriptorType::Graphics:
DupItem.GraphicsDesc.FromString(StringRep);
Temp = DupItem.GraphicsDesc.ToString();
break;
case FPipelineCacheFileFormatPSO::DescriptorType::RayTracing:
DupItem.RayTracingDesc.FromString(StringRep);
Temp = DupItem.RayTracingDesc.ToString();
break;
default:
return false;
}
const bool bFirstCheck = DupItem == TempItem;
if(!bFirstCheck)
{
UE_LOG(LogShaderPipelineCacheTools, Warning, TEXT("FAIL\n\nItem\n%s\nDupItem\n%s"), *StringRep, *Temp);
}
return (DupItem == TempItem) && (GetTypeHash(DupItem) == GetTypeHash(TempItem));
}
Here’s what you can see wrong:
Item
23F35A661C129FDA205511F696EF6BACA2AED781,0743E2BFC32A62EE48BD6F8BB8DE108B8D4A7D69,0000000000000000000000000000000000000000,0000000000000000000000000000000000000000,0000000000000000000000000000000000000000,<0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 1 0>,<0.000000 0.000000 2 1 0 1 0>,<1 3 0 7 0 0 0 0 7 0 0 0 255 255>,4,11,4620,2,2,0,0,0,1,37,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,14,<0 0 3 0 12 0>,<1 0 5 1 8 0>,<1 4 5 2 8 0>,<2 0 12 5 4 0>,<2 0 12 6 4 0>,<2 0 12 7 4 0>,<2 0 12 8 4 0>,<3 0 8 13 0 0>,<4 0 6 3 16 0>,<4 4 6 14 16 0>,<4 8 7 4 16 0>,<4 12 7 15 16 0>,<5 0 3 9 0 0>,<5 0 3 10 0 0>,<0 0 0 0 0 0>,<0 0 0 0 0 0>,<0 0 0 0 0 0>
DupItem
23F35A661C129FDA205511F696EF6BACA2AED781,0743E2BFC32A62EE48BD6F8BB8DE108B8D4A7D69,0000000000000000000000000000000000000000,0000000000000000000000000000000000000000,0000000000000000000000000000000000000000,<0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 1 0>,<0.000000 0.000000 2 1 0 1 0>,<1 3 0 7 0 0 0 0 7 0 0 0 255 255>,4,11,4620,2,2,0,0,0,1,37,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,14,<0 0 3 0 12 0>,<1 0 5 1 8 0>,<1 4 5 2 8 0>,<2 0 12 5 4 0>,<2 0 12 6 4 0>,<2 0 12 7 4 0>,<2 0 12 8 4 0>,<3 0 8 13 0 0>,<4 0 6 3 16 0>,<4 4 6 14 16 0>,<4 8 7 4 16 0>,<4 12 7 15 16 0>,<5 0 3 9 0 0>,<5 0 3 10 0 0>,<0 0 0 0 0 0>,<0 0 0 0 0 0>,<0 0 0 0 0 0>
Doing a diff:
23F35A661C129FDA205511F696EF6BACA2AED781,0743E2BFC32A62EE48BD6F8BB8DE108B8D4A7D69,0000000000000000000000000000000000000000,0000000000000000000000000000000000000000,0000000000000000000000000000000000000000,<0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 0 1 0 0 1 0 15 1 0>,<0.000000 0.000000 2 1 0 1 0>,<1 3 0 7 0 0 0 0 7 0 0 0 255 255>,4,11,4620,2,2,0,0,0,1,37,160,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,2,0,14,<0 0 3 0 12 0>,<1 0 5 1 8 0>,<1 4 5 2 8 0>,<2 0 12 5 4 0>,<2 0 12 6 4 0>,<2 0 12 7 4 0>,<2 0 12 8 4 0>,<3 0 8 13 0 0>,<4 0 6 3 16 0>,<4 4 6 14 16 0>,<4 8 7 4 16 0>,<4 12 7 15 16 0>,<5 0 3 9 0 0>,<5 0 3 10 0 0>,<0 0 0 0 0 0>,<0 0 0 0 0 0>,<0 0 0 0 0 0>
There’s a 16 in one and not the other, for every shader.