Hi,
I’m running with PSO precaching validation on to try and find missing precaching in our code, however I also found some missing paths in the engine itself and wanted to report them:
-FCustomDepthPassMeshProcessor ignores FPSOPrecacheParams::PrimitiveType which causes it to fail to precache Groom shaders. Changing the code to pass though this value instead of hardcoding PT_TriangleList solves the issue though.
-FSkyPassMeshProcessor seems to use the wrong RT formats when it precaches. It ignores the value of r.SkyLight.RealTimeReflectionCapture.DepthBuffer and even when that’s fixed there seem to be remaining mismatches.
-FVolumetricCloudRenderViewMeshProcessor and FVolumetricCloudRenderShadowMeshProcessor don’t implement PSO caching and UVolumetricCloudComponent does not either, adding it is unfortunately not trivial since it’s not a UPrimitiveComponent so it can’t reuse the generic infrastructure there.
-FGeometryCacheVertexVertexFactory doesn’t implement PSO precaching.
The FCustomDepthPassMeshProcessor issue is a simple fix we have made locally, but the others seem more complex to resolve. I was wondering if Epic was aware of these and if they were planned to be fixed. The Sky material ones are problematic for us since our sky materials tend be large and complex shaders, so they take a long time to compile and would benefit from precaching to avoid hitches.
Thanks!
Steps to Reproduce
Set r.PSOPrecache.Validation=2
Hi,
Thanks for bringing this up. We have not encountered these use cases for PSO precaching, but we are interested in potentially integrating this into the engine. Before we do this, could you create a small project that contains the use cases you described? This would help us track down and verify the necessary changes. Let me know what you think.
Cheers,
Tim
Hi Tim,
Sure, here’s a 5.5 sample project using some Epic example assets which reproduces the issue. I’ve set r.PSOPrecache.Validation=2 via .ini already so if you cook a Win64 package and run it, you’ll see the logs.
`[2025.05.29-23.20.42:370][ 0]LogEngine:
PSO PRECACHING MISS:
Type: ShadersOnly
PSOPrecachingState: Untracked
Material: M_DefaultGeometryCacheMaterial
VertexFactoryType: FGeometryCacheVertexVertexFactory
MDCStatsCategory: GeometryCacheComponent
PassName: BasePass
Shader Hashes:
VertexShader: CB9EAB30F147E36E2F297252EDC004542B717FDD
PixelShader: 398DB6FDB4331CED1AAAB7BBE8EB2C496E00A85A
Untracked Info:
- VertexFactory doesn’t support PSO precaching.
…etc`This sample reproduces the 4 cases I mentioned above, but it would be great if Epic could do a pass of engine code to make sure everything is implementing PSOPrecaching correctly since there could be more that we haven’t spotted yet.
We also get some EPSOPrecacheResult::TooLate hits for ULandscapeComponents using RVT when we have Nanite landscape enabled. I have the same setup here but I’m not seeing those logs in my sample project, so possibly this is timing dependent.
Hi Lucas,
Thanks for sharing the repro project. I was able to verify that the PSOs are indeed being missed currently in the engine. I’ve filed a ticket with the engineering team to review the current PSO Precaching coverage in the engine and add your suggestions. Having chatted with some of the devs, FCustomDepthPassMeshProcessor, FVolumetricCloudRenderViewMeshProcessor, FVolumetricCloudRenderShadowMeshProcessor, and UVolumetricCloudComponent should be pretty straightforward to add. Still, we must evaluate how many PSO variations we will add. As for the other mesh processors, it will take some more time to get them properly added.
Unfortunately, due to how our Jira is set up, I cannot share a public tracking link with you. However, I will try to get you any updates on this effort as soon as possible. If you have any more questions, please don’t hesitate to let me know.
Another update. I just got word that we have added precaching to the PSOs you had called out earlier. The CLs for these changes can be found in UE5-Main 43381360. Feel free to let me know if you have any more questions.
Great, I’m glad to hear that. With that, I’ll close out the ticket.
Thank you! That looks like it covers everything