My team is preparing for a PC launch on Steam, and we are plagued by "compilation jank" during the first 10 minutes of gameplay. Since we are using a custom engine, what are the modern industry standards for pre-caching Pipeline State Objects (PSOs) or using async compilation to fix this?
3 answers
Shader stutter is the number one complaint for PC gamers right now. The gold standard is to implement a "pre-calculation" step during the first launch or a loading screen. You need to record all used PSO combinations during a QA play session and save them to a file. On the user's end, you read this file and call CreateGraphicsPipelineState for every entry before the game starts. It adds 2-3 minutes to the initial load, but it eliminates the stuttering entirely. Also, look into the D3D12_FEATURE_DATA_SHADER_CACHE to check if the driver already has a cached version available.
Is it feasible to use a generic "background compiler" that prioritizes shaders based on the player's current view frustum to reduce that initial wait time?
Many modern games now include a "Compiling Shaders" progress bar on the main menu. It’s become a bit of a meme, but players prefer it over a stuttery experience.
Honestly, Theresa, players have become very forgiving of that 60-second wait if it means the actual gameplay is butter-smooth. It’s much better for your Steam reviews in the long run.
Franklin, background compilation is great, but the problem is that if the player turns around quickly and the shader isn't ready, the game will still hitch as the driver forces a synchronous compile. Pre-caching everything is annoying for the player, but it's the only 100% reliable fix for DX12 jank.