Microsoft announced this week that they are working on a new update for DirectX 12 Ultimate that they hope will reduce load times and shader-related stuttering in games. They call it "advanced shader delivery" and they claim it "addresses one of the most frustrating challenges for PC gamers today." That being long load times and "disruptive stuttering during a game's first launch."
These delays are caused by the need to compile graphics shaders and cache them for future use. For a deep-dive on this topic, we recommend reading Epic’s article – “Game engines and shader stuttering.”
It sounds like they're just pre-compiling the shaders for a bunch of different PC hardware configurations and sending you the ones that match your PC. It sounds like that because that's essentially exactly what they're doing.
How does it work?
A game interacts with the GPU using programs called shaders, which are responsible for things like lighting, texturing, physics, and more. These shaders need to be compiled to a GPU-specific format –by sending them to the GPU driver in an intermediate form– before they can be used. Since these compiled shaders are specific to the game, GPU, and driver on a given device, it’s not traditionally been feasible to compile in advance – the best option so far is at game launch in the form of a loading screen, or else it needs to be done “just-in-time” which can cause stuttering. Once these shaders are compiled, they can be cached for subsequent runs of the game – until the driver updates and invalidates those caches.
To circumvent this issue, the DirectX team has created a method to collect the shader data from any given game and package it up in a new standardized format, called a State Object Database (SODB). We have worked with our key hardware partners to separate out the shader compiler from the graphics driver and unite the game data in the SODB with the compiler in the cloud to create a Precompiled Shader Database (PSDB). This PSDB can be distributed by the Xbox store alongside the game to supplement the shader cache. Now, when a game runs for the first time, it will see all the shaders it needs already available in a cache in Windows and can skip doing that compilation step on the gaming device. If a device takes a driver update, we will detect that and update the shader cache automatically.
A game interacts with the GPU using programs called shaders, which are responsible for things like lighting, texturing, physics, and more. These shaders need to be compiled to a GPU-specific format –by sending them to the GPU driver in an intermediate form– before they can be used. Since these compiled shaders are specific to the game, GPU, and driver on a given device, it’s not traditionally been feasible to compile in advance – the best option so far is at game launch in the form of a loading screen, or else it needs to be done “just-in-time” which can cause stuttering. Once these shaders are compiled, they can be cached for subsequent runs of the game – until the driver updates and invalidates those caches.
To circumvent this issue, the DirectX team has created a method to collect the shader data from any given game and package it up in a new standardized format, called a State Object Database (SODB). We have worked with our key hardware partners to separate out the shader compiler from the graphics driver and unite the game data in the SODB with the compiler in the cloud to create a Precompiled Shader Database (PSDB). This PSDB can be distributed by the Xbox store alongside the game to supplement the shader cache. Now, when a game runs for the first time, it will see all the shaders it needs already available in a cache in Windows and can skip doing that compilation step on the gaming device. If a device takes a driver update, we will detect that and update the shader cache automatically.
In the short term, Microsoft says they're working on supporting this tech with the launch of the ROX Xbox Ally and ROG Xbox Ally X. They plan to release the AgilitySDK in September, which will give both developers and other storefronts the initial tools and APIs needed to expand the use of advanced shader delivery across the industry. This means, in theory, that if Valve or Epic choose to, they will also be able to bundle the pre-compiled shader caches in with game downloads in the near future.
Of course, shader compilation woes are one stutter issue plaguing modern games. The other stutter issue is the dreaded traversal stutter found in pretty much every Unreal Engine 5 title, especially the open world ones. Epic supposedly made significant strides to address traversal stutter for Unreal Engine 5.6, but that update came out only in June and I don't think any game currently on the market is using it just yet.


