Download

Cached PSO (Pipeline State Objects) getting discarded due to "inconsistent vertex format"

Hi. I am attempting to generate PSO caching information for a DX12 windows project. I have gone though most of the steps in the documention here.

PSO Caching | Unreal Engine Documentation

Some of it was a bit confusing or not clear, but I managed to get PSOs logged from a cooked game, ShaderStableInfo*.scl.csv, and *_PCD3D_SM5.stablepc.csv ouput. During a cook to put all these together into PSOs that the FShaderPipelineCache would load at runtime, I run into these issues. It appears to be pruning away a lot of our potential PSOs due to inconsistent vertex format. But I’m not sure how to resolve this. As far as I can tell, there isn’t a lot we do to control the vertex format? We mostly use static meshes in our game. It seems UE4 should be able to log enough info to be able to create these without conflict, since it’s able to create the PSOs at runtime when not using PSO caching.

Does anyone have any information or clues to help here? I’d like to get the PSO caching working as well as possible to prevent any hitches at runtime.

Thank you.

UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: Running sanity check (consistency of vertex format).
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: 13 vertex shaders are used with an inconsistent vertex format
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: The following inconsistencies were noticed:
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: 124 times one PSO used the vertex shader with VET_PackedNormal (5), another VET_Short4N (14) (we don't know VS signature so assume it needs the larger type)
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: These vertex shaders are used with an inconsistent vertex format:
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: 0: 232 shaders matching hash 7EB33B958D9C497E0DDCEB0266B559AFBE466679
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display:     Example: Material Game/StarterContent/PartsMasterMaterial.PartsMasterMaterial,TBasePassVSFPrecomputedVolumetricLightmapLightingPolicy,MeshMaterial,MD_Surface,SM5,Num,SF_Vertex,PCD3D_SM5,FLocalVertexFactory,Perm_0,7EB33B958D9C497E0DDCEB0266B559AFBE466679,000000000000000000000
0000000000000000000
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: 1: Material Engine/EngineMaterials/WorldGridMaterial.WorldGridMaterial,TShadowDepthVSVertexShadowDepth_PerspectiveCorrectPositionOnly,MeshMaterial,MD_Surface,SM5,Num,SF_Vertex,PCD3D_SM5,FLocalVertexFactory,Perm_0,BAD55A7C93483C8EC6780F31549ABABE95CED2B4,0000000000000000000000000
000000000000000
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: 2: 127 shaders matching hash F05489C8B6D052BFAED8D2DEC85E71D75DFA381E
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display:     Example: Material Game/TestContent/Test_material_7.Test_material_7,TBasePassVSFPrecomputedVolumetricLightmapLightingPolicy,MeshMaterial,MD_Surface,SM5,Num,SF_Vertex,PCD3D_SM5,FLocalVertexFactory,Perm_0,F05489C8B6D052BFAED8D2DEC85E71D75DFA381E,00000000000000000000000000000000
00000000
...
... (more examples here)
...
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: === Sanitizing results ===
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: Before sanitization: ....................................................................   1976 PSOs
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: Filtered out due to inconsistent vertex declaration for the same vertex shader:..........   1025 PSOs
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: Filtered out due to VS being possibly incompatible with an empty vertex declaration:.....      0 PSOs
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: -----
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: Number of PSOs after sanity checks:......................................................    951 PSOs
UATHelper: Packaging (Windows (64-bit)):   LogShaderPipelineCacheTools: Display: Wrote binary PSOs, (355KB) to C:/Work/Wrench/Saved/Cooked/WindowsNoEditor/WrenchGame/Content/PipelineCaches/Windows/WrenchGame_PCD3D_SM5.stable.upipelinecache
UATHelper: Packaging (Windows (64-bit)):   LogCook: Display: ---- Done running UShaderPipelineCacheToolsCommandlet for platform WindowsNoEditor