I am trying to fix performance issues with stuttering that are continuously happening in my android game. I have followed the instructions at https://dev.epicgames.com/documentation/en\-us/unreal\-engine/manually\-creating\-bundled\-pso\-caches\-in\-unreal\-engine and no matter what I do I continue to see hitches and the “Encountered new compute PSO” log when my niagara systems are swapped out dynamically at runtime.
We are using unreal engine 5.2 but we’ve backported these changes into our engine codebase:
- https://github.com/EpicGames/UnrealEngine/commit/15ceb1985fe60b6a0260967511223efc0392bbce
- https://github.com/EpicGames/UnrealEngine/commit/b6449bb472ed040924b84394d2ffc427cc407b4c
I set the value of `r.Shaders.ExtraData` to true and added a few extra logs during PSO expansion, builds, and when we hit the “Encountered new compute PSO” log and I can see lines related to my niagara system in the expansion and build logs.
I printed the hash of each PSO that was added during the build (after expansion takes place in our build pipeline) and I can cross reference that same hash to my runtime log where it says a new compute PSO was encountered. The hashes are the same, yet my game build ALWAYS attempts to create and save the new pso every single time I run it.
PSO caches work for us regularly.. it is often something we do when we are performance tuning but for some reason I just can’t get these particular niagara systems to play along with everything else.
I also run the console commands in my build before I start swapping out the actors with the niagara systems attached
`r.ShaderPipelineCache.PrintNewPSODescriptors 2`
`log LogRHI VeryVerbose`
They have been helpful in tracking things down.
So it all comes down to these questions:
- All your documentation says “compute psos are collected during builds, unlike the rest”. It isn’t explicitly stated that you CANNOT record compute shaders into a cache and then expand them… but it would be nice to know explicitly if this is not possible. So is it possible to record (-logPSO) compute shaders from my android game and then put those recording files and then use the PSO expand commandlet to convert that into an .shk file that my next build can use to avoid histches?
- If it is not possible, are there any good suggestions for best practices on ensuring that all my BP assets get the proper compute state cached during builds to avoid these hitches? Currently all these niagara systems are part of a library of content that a user can decide when to load. This library will grow over time and we want to let the user pick various content and have it become visible without any PSO related hitches.
- Are there any more debug tools I can use to track down why these niagara systems are not making into any cache file?
It seems highly likely that you’ll need more information to help me drill down to an answer here so just let me know what you need from me and I will do the best I can. I cannot send any samples from my project unfortunately and it has gotten big enough that trying to chisel off a portion of it to isolate and send would be extremely difficult.
[Attachment Removed]