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?
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.
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
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.
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.
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.
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