Skip to content
Written and edited in-house.Every figure, date and quote is taken from a named primary source — never from another site’s summary.Editorial policySpotted an error?
PC performance

Shader compilation stutter: why PC games hitch in the first hour

Games··6 min read

Shader compilation stutter is a cache and pipeline problem, not proof that a PC lacks the muscle for a title. The same machine can hitch again after a driver change because compiled shader results are tied to the current compiler version. What feels like a broken frame is often just a compile-in-progress, and it behaves exactly the same on a budget laptop and a workstation with a graphics card that costs as much as the rest of the system combined.

A close view of the circuit board of a graphics card
The silicon a shader has to be compiled for. Until that work is done, the frame waits. Gormé · CC BY-SA 3.0 · Wikimedia Commons

The stall is a compile, not a drawing problem

When a game runs, the GPU needs shaders—programs that control how every pixel is lit and textured—in a binary form the hardware can execute directly. The driver takes the shader source, written in a high‑level language, and compiles it into the GPU’s own instructions. That step costs time. If it happens mid‑frame while the engine is waiting for the shader to be ready, the frame is delivered late and the player sees a hitch. NVIDIA’s developer documentation explains the mechanism plainly: when the driver encounters a new piece of shader source, it first searches an automatic shader cache to check whether it has already compiled that source with the current version of the compiler. A hit means the driver loads a pre‑built binary instantly; a miss means it compiles the shader on the spot and saves a copy in the cache so the same stall does not repeat. The whole transaction lives between the game, the driver, and a cache that exists on disk and, in the case of Microsoft’s D3D12 in‑process shader cache, can also hold compiled entries in memory for the running application. The D3D12 cache is optional, and games can check for its support with the CheckFeatureSupport call. If it is absent or cold, the compile happens exactly when the shader is first drawn, and no amount of raw GPU throughput can dodge that pause.

Why fast hardware still hits the wall

Caches persist between play sessions. NVIDIA’s developer guidance confirms that the automatic shader cache survives application exits, which is why a second run of the same game on the same driver is nearly always stutter‑free: all the shaders have already been compiled and stored. The persistence is keyed to the shader source and the compiler version that built it. Change either and the binary no longer matches what the current driver expects. A PC with an expensive GPU will therefore hitch not because it cannot render frames quickly, but because it must re‑compile every shader that was valid an hour earlier. The machine is fast where it counts—pushing pixels—but that has no bearing on the compilation step. As NVIDIA documents it, compilation need only occur the first time a new driver is installed. Everything after that runs from the cache. So a single driver update is all it takes to turn a previously flawless game into a stuttering mess for the first few minutes of play.

How precompilation lightens the load, but does not remove it

Vendors and engine developers have built layers above the raw compile step so that the work happens earlier. Intel’s support pages describe a system called precompiled shaders that automatically downloads pre‑optimised shader files to the PC, checking each file against the specific hardware and driver configuration. When the match is exact, the game never needs to trigger a compile at all. Unity’s engine‑side tooling takes a different approach. Its shader variant cache stores compiled variants so that the same variant reused later in a session does not cause another stall. A separate Caching Shader Preprocessor is tuned to speed up shader import and compilation during development, but the benefit at runtime is that fewer unexpected compiles spring up. Yet these safeguards are conditional. Intel’s precompiled shader delivery will only serve files that align perfectly with the installed driver; any mismatch triggers the standard on‑demand compile. Unity’s troubleshooting notes list driver shader caches for AMD, Intel, NVIDIA, the D3DSCache, and the Steam shadercache as distinct locations that the player may need to deal with, and the Unity manual warns that its engine‑level shader caches can be cleared separately from the driver‑level caches. The separation means one cache being hot does not guarantee the other is, and a change that flushes the driver side can still leave the player watching a spinning camera while a shader compiles.

Why a driver update breaks the cache

A driver update replaces the shader compiler. Because the cache is indexed against the compiler version, every stored binary becomes suspect. NVIDIA’s documentation that the driver compiles only when the current compiler version has not already produced that binary is the key here. A freshly updated driver sees a cache full of binaries built by an older compiler and decides they are unsafe; it discards them and starts over. Unity’s guidance for resolving D3D12 GPU crashes on Windows reinforces this by directing users to clear driver shader caches for all three GPU vendors, the D3DScache, and the Steam shadercache, and then to restart the computer so that no stale cached shaders remain in memory. The sequence is close to a factory reset of the shader state. A player who upgrades a driver may find that games that ran smoothly now hitch for a while, not because the new driver is slower but because the cache is being rebuilt from scratch. There is no practical way around it; the compiler version changes, and the work must be redone.

What players can actually try

The options available on the player side are limited because the root cause is the driver’s compilation step, not a ticked option in a settings menu. The most reliable course is to let the caches warm up: play through the first few minutes of stutter, knowing the behaviour will settle. If stuttering never stops, clearing the caches properly can break a loop where a corrupted entry forces repeated recompilation. Unity’s manual lists the exact locations—driver shader caches for AMD, Intel, and NVIDIA, plus the D3DSCache and the Steam shadercache—and instructs that the computer be restarted after clearing so that no cached shaders linger in memory. That procedure is essentially a forced cache re‑build, and it can help when a game remains choppy long after it should have stabilised. There is, however, no in‑game toggle that prevents shaders from compiling. The only effective mitigation is a pre‑loading or pre‑compilation step that the engine performs before gameplay begins, and that decision rests entirely with the developer.

The engine design still decides the worst of it

Even when the driver cache is perfectly warm, the engine can create fresh stalls by demanding shader variants that have never been compiled before. Unity’s shader variant cache exists precisely to avoid this problem; it holds a compiled variant ready so that the same combination of lighting conditions and material does not trigger a compile again. But if the engine’s variant count is high and a particular effect or material is encountered for the first time mid‑level, the compile still happens. The Caching Shader Preprocessor in Unity speeds up shader handling during the build pipeline, but at runtime the vulnerability depends on whether the engine has pre‑compiled every variant the camera might ever see. No amount of driver‑cache warming fixes a game that keeps throwing new variants at the GPU on the fly, and that is why two titles running on identical hardware and drivers can behave so differently: one precompiles aggressively, the other does not. That decision is baked into the engine code, and no setting outside the game can alter it.

Caches reduce repeated work, but they do not erase the cost of a new compile. The hitch returns whenever the compiler version changes, the cache state is stale, or the engine asks for a shader variant it has never seen before. It is not a glitch to be solved with a faster graphics card; it is a pipeline fact that lives between the driver, the game, and the ticking clock of every frame.