How to Enable Automated Pso Caching in UE 5.1?

Improvements to PSO precaching is mentioned on Epic’s public roadmap for UE 5.2, so I figure now is as good a time as any to ask about this. Apparently UE 5.1 introduced some sort of automatic PSO caching process to help address shader compilation stutters, but I have not been able to find any information on how it works, how to activate it, or even how to tell if it’s happened at all.

To my knowledge, Epic has not created any documentation for this feature. In fact, the documentation on PSO caching itself hasn’t been updated since UE 4.26. Is there anyone who can shed light on this for me?

1 Like

shader pipelines are not that easy to deal with. even if you cache them on disk, you gotta reload them for all the shader permutations used in the level and link the shaders at runtime. generation on the fly is just as fast. hmm. a necessaty evil atm.

if you’d static link all shader permutations you’d get alot of redundant shader code data. shaders are fairly small pieces of code, but… alot them can make a difference.

not sure. ohh well…

word of advice… use less material variations and more material instances. if understand their concept they are gold, really. if you need special shaders make sure to recycle their code. fairly ez deal.

1 Like

I appreciate the insight, and I have heard about how helpful the use of material instances can be. However, answers like yours are part of the reason why I’m concerned about Epic’s lack of transparency :sweat_smile:

I’m a long ways off from making anything complex enough for shader complication stutter to be an issue, but with the subject coming up more and more I’d like to learn how I can mitigate or avoid it when the time comes. Epic simply saying “we’re doing automated PSO caching” and then walking out the door just isn’t enough for me.

2 Likes

The documentation is here, https://docs.unrealengine.com/5.0/en-US/optimizing-rendering-with-pso-caches-in-unreal-engine/

I am doing this at the moment for my game and have successfully collected the caches while playing the game. I am stuck at the point where I have to covert the PSO cache also know as expansion using a cmd commandlet. If you do get to this point please tell me how it works.

1 Like

That’s the documentation for collecting PSOs manually; what I’ve been referring to is an automated PSO-gathering process that was supposedly introduced in UE 5.1. And part of the release notes for UE 5.2 state that Epic has improved it. Yet you can’t find anything on the Internet on how it works, or how a developer can even tell that PSOs are being gathered automatically.

For all I know, Epic could be lying about the entire thing…though I don’t actually believe that they are. But they haven’t made any information about the automated PSO caching public, which to me is problematic because shader compilation stutter is plaguing games both large and small. Hiding information about the most recent ways it’s been addressed is helping no one.

1 Like

In the documentation the is a suggestion for a workaround.
After looking at the backed code assets all call PrecachePSOs(); on post load which later calls CollectPSOPrecacheData() with parameters.

I hope they make a tool that gathers objects in a level and potential streams and automates the process in the future.

Do I need to make special PSO caching levels?

While you can capture all needed PSO data from your project’s standard levels, some projects may benefit from creating special PSO capture levels. These levels can be set up so they spawn all assets of a particular type and then capture their PSO data. This is especially true if your project has content that takes time to unlock or is dynamically spawned."

Also this thread might give a clue, it seems there is a shaderpipelinecachetools commandlet

1 Like

The commandlet is for processing the data after collection.

I found this, but I have not tried it yet: Setting up PSO Precaching & Bundled PSOs for Unreal Engine - Tom Looman

1 Like

I saw that around the time Tom first posted it, and it was a godsend! Following his instructions got me the results I was looking for.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.