Mobile game now requires massive amount of PSO to pre-warm to prevent CPU hitching during game play.
Even after removing redundant permutations, it still requires minutes to warmup the cache on mainstream devices.
Luckily, UE5 gives us a solution, we can compile PSO in async style in different android services(A service is a long running background task in Android, kind like a separate process.) to speed up the process.
https://github.com/EpicGames/UnrealEngine/commit/aa7ba3ecfd05d3d2b9a12c9d2d4131b9d78e3a42
https://github.com/EpicGames/UnrealEngine/commit/bde84ad858735d44180a1c9e1a749a1350a4906f
This works fine in OpenGL RHI, it gives us a 2x compile time boost.
But it's worse in Vulkan RHI. Both approach looks identical, i wonder if there's any restriction in vulkan's driver implementation that limits this use pattern.
After some logging and code review, i figured the vulkan driver works fine.
It's not related to driver side. It's related to engine side, we shouldn't add prerequisite when pre compiling PSO:
https://github.com/EpicGames/UnrealEngine/blame/27cfc10a10d6a8e97c6828687196252ca31d163a/Engine/Source/Runtime/RHI/Private/PipelineStateCache.cpp#L2055
Now we have a 2x boost in vulkan as well.
Thank you for returning to share the solution you found with the community!