Before the GPU can draw anything, the graphics driver needs the shaders and GPU state for that draw in a form it can run. Older graphics APIs, such as Direct3D 11, set GPU state through dozens of separate calls right before each draw. More recent graphics APIs, such as Direct3D 12 (D3D12), Vulkan, and Metal, package this state into Pipeline State Objects (PSOs) so the GPU can switch states more quickly.
PSOs make rendering more efficient, but creating a new PSO on demand can take 100 or more milliseconds, because the driver has to compile its shaders and configure every parameter. If this happens the first time something appears on screen, players see a hitch. If it happens during startup, players see long load times.
To avoid this, the shaders and PSOs your application needs should be compiled before they are used. Unreal Engine provides several ways to do this, described on this page.
Terminology
Pipeline State Object (PSO) is the D3D12 term for GPU state. Other APIs use slightly different names. For example, Vulkan uses pipeline, and Metal uses pipeline state. Conceptually, they are similar.
PSO cache: A file with PSO descriptions that is included in your build, so the application can create these PSOs early. In other words, a list of PSOs to create early.
State Object Database (SODB): A GPU-independent file that contains the shaders and PSOs of your application, used by DirectX Advanced Shader Delivery.
Precompiled Shader Database (PSDB): The result of compiling an SODB for a specific GPU family and driver.
Unreal Engine supports three types of PSOs:
Graphics PSOs, which represent the state of the graphics pipeline and consist of many configurable variables.
Compute PSOs, which contain only a compute shader.
Ray tracing PSOs, which are used for ray tracing. PSO precaching and Advanced Shader Delivery do not support them.
Approaches
Unreal Engine has three approaches to compiling shaders and PSOs ahead of time. They differ in when compilation happens, where it happens, and how much setup they need.
| PSO Precaching | Bundled PSO Cache | Advanced Shader Delivery (ASD) | |
|---|---|---|---|
What it does | Automatically collects the PSOs that loaded components could need, and compiles them in the background. | You record the PSOs used while playing your application and ship that list with your build. The application compiles them at startup. | You generate an SODB from your cooked build. The store compiles it for each GPU family and driver, and players download the results with your game. |
Where compilation happens | On the player's machine, at runtime. | On the player's machine, at startup. | Ahead of time, by the store. |
Platforms | RHIs that support PSO precaching. | D3D12, Vulkan, Metal, and OpenGL ES (program objects). Not D3D11. | Windows, D3D12 SM6 only. |
Setup | Enabled by default. | Manual recording and processing for each platform and graphics API. | Generate an SODB with the ASD Tool whenever shaders change, and submit it to the Microsoft Store. |
PSO Precaching
PSO precaching is the main system for avoiding PSO hitches and is enabled by default. When a component loads, Unreal Engine collects all the PSOs it could need to render, based on its materials, vertex factories, and the mesh passes it can be drawn in, then compiles them asynchronously. Certain global shader PSOs are also precached at engine startup.
For more information, see PSO Precaching.
Bundled PSO Cache
A bundled PSO cache is a list of PSOs recorded from running your application, then included in your build. The steps are:
Play the game.
Log what is actually drawn.
Include this information in the build.
On later runs, the application compiles the PSOs in the cache before the rendering code needs them. When PSO precaching is enabled, a bundled cache is often not necessary, but it can cover PSOs that precaching misses.
For more information, see Creating a Bundled PSO Cache.
Advanced Shader Delivery
DirectX Advanced Shader Delivery (ASD) moves shader compilation out of the game. You use the ASD Tool to generate a State Object Database (SODB) from your cooked Windows build and submit it to the Microsoft Store (Epic Games Store support is planned for early 2027). The store compiles the SODB into Precompiled Shader Databases (PSDBs) for each supported GPU family and driver, and downloads the matching one to the player's machine.
The SODB can include all compute shaders in your build and the graphics PSOs from a PSO cache. Graphics PSOs are only included through a PSO cache, so the quality of your bundled PSO cache determines how much of the graphics workload ASD covers. ASD works alongside PSO precaching and bundled PSO caches and does not replace them. Stores only provide PSDBs for supported GPU families and a limited set of recent drivers, so keep PSO precaching and your bundled PSO cache set up for players that ASD does not cover.
For more information, see Generating a State Object Database for Advanced Shader Delivery.
Choosing an Approach
Start with PSO precaching. It is enabled by default and requires no recording.
Add a bundled PSO cache if you still see PSO hitches with precaching enabled, or if you plan to use ASD and want it to cover graphics PSOs.
Use ASD for Windows D3D12 SM6 builds distributed through the Microsoft Store, to reduce first-launch compilation on players' machines. Keep PSO precaching and your bundled PSO cache set up alongside it.
Pages in This Section
PSO Precaching
Use PSO precaching to automatically collect and compile PSOs.
Creating a Bundled PSO Cache
Manually create and bundle a PSO cache with your game.
Generating a State Object Database for Advanced Shader Delivery
Generate a State Object Database from your cooked build to enable stores to precompile its shaders ahead of time.