한국어English日本語简体中文繁體中文DeutschไทยTiếng ViệtРусскийPortuguês (Brasil)EspañolBahasa Indonesia

Game Lag White Paper › L1 Client game process

Synchronous loading and shader compilation on the main thread Synchronous asset load, shader compile

Cause ID cg-sync-load · Primary owner Game team (Client development)

Open the interactive card with figures and simulations →

The game freezes to read files and build shaders right before it draws an area, monster, or effect for the first time.

Why Entering a new area, or a skill, piece of gear, or monster appearing for the first time → Effect The main thread waits for file reads and shader compilation → On screen A 0.1–1 s freeze the first time only; fine from the second time on

Symptoms
Freeze, Stutter
Factors
Stall
Who’s affected
Just me
When
While moving or changing zones, During specific actions
Owner
Primary owner Game team (Client development)
Game team action items
Load asynchronously, preload (prewarm), precompile shaders on the loading screen or at first launch, make use of loading screens.
Ballpark numbers
Compiling one shader takes tens of ms, sometimes over 100 ms. Loading a texture takes tens to hundreds of ms depending on storage speed.
On the graph
Surge after opening · Frame spike count (right after a patch or driver update)
Where to look
Record the same route twice with PresentMon and compare the first visit with the second. In a development build, turn on r.PSOPrecache.Validation in Unreal and check stat PSOPrecache and “PSO PRECACHING MISS” in the log; in Unity, check the loading and shader sections of spiking frames in the Profiler’s Timeline view
Confirmed if
0.1–1 s spikes only at places visited or skills used for the first time, gone on the second visit. Reports surge right after a patch or graphics driver update, then taper off
Ruled out if
Spikes every time at the same place: not a shader cache problem. Repeats on every move only on PCs with slow storage: “Slow storage delays asset streaming.” Dedicated GPU memory full: “Out of graphics memory (VRAM)”
Check with
Game server or client logs and metrics
Learn more
On PC, the graphics driver stores each shader it builds in a shader cache and reuses it. So right after a graphics driver update or a game patch, that cache is invalidated, and even players who were fine stutter again for a while. The classic report is “after the patch, it hitches everywhere I go for the first time.”

Sources

  1. Shader loading Unity
    The first time a shader variant is used, the graphics driver has to build it for the GPU, which can cause a noticeable freeze; once built, it’s cached and doesn’t freeze again
  2. Optimizing Rendering With PSO Caches in Unreal Engine Epic Games
    Creating a pipeline state object (PSO) at the moment it’s needed can take over 100 ms, so PSOs should be created in advance
  3. Direct3D 12 Return Codes Microsoft
    D3D12_ERROR_DRIVER_VERSION_MISMATCH: a PSO cache built with a different driver version can’t be reused (recompiled after a driver update)
  4. PresentMon Capture Application (README-CaptureApplication.md) Intel
    Records per-frame time as FrameTime (CPU time between frames)
  5. PSO Precaching for Unreal Engine Epic Games
    With r.PSOPrecache.Validation on, stat PSOPrecache shows missed PSO statistics and the log records “PSO PRECACHING MISS”; runtime PSO creation over 20 ms (default) counts as a hitch

See also

Same layer: L1 Client game process

Same symptom (Freeze), other layers

View the interactive card with figures and simulations