Shader compilation stutter: why the first minutes are the worst

Why a game hitches on everything it shows you for the first time, why a driver update brings it all back, and why deleting the shader cache is the one "fix" that guarantees you pay for it again.

You start a game you have not played in a while and the first ten minutes are awful. Every new weapon, every new effect, the first time a particular enemy appears — a hitch. Then it settles, and by the second evening the game is smooth. Nothing you changed did that. Time did.

Or the other version: the game was fine, you updated the graphics driver, and the whole first hour is rough again.

Both are the same mechanism, and it is one of the few causes of stutter that is genuinely normal, in the sense that a healthy machine running correct software produces it.

Why the work has to happen on your machine

A shader is a small program that runs on the GPU. The game's developer writes it in a high-level language and compiles it, but only part of the way — to an intermediate form that describes what the program does, not how any particular graphics chip should do it.

The machine code your GPU actually executes cannot be produced in advance, because it depends on two things the developer does not have: your exact GPU architecture, and your exact driver version. The driver's own compiler is what turns the intermediate form into instructions for the silicon in your machine, and that compilation happens on your CPU, at the moment the game needs the shader.

So the first time a scene needs a particular combination of shader, render state and vertex layout, something has to be compiled. If the game asks for it in the middle of a frame and waits, that frame is late. That late frame is the hitch you felt.

The result is written to a shader cache on disk. The second time the same thing appears, the compiled code is read from the cache instead of being rebuilt, which is exactly why the game gets better as you play and why the second session is fine.

What sends you back to the start

The cache is only valid for the driver and hardware that built it. Anything on this list invalidates it, wholly or partly, and the first hour of play is rough again:

None of these are faults. They are the cost of a cache being correct rather than stale.

How to tell this is what you have

Shader compilation has a distinctive fingerprint, and it does not look like anything else on the stutter list:

  1. It fades. This is the defining sign. If your stutter is the same in hour three as in minute three, it is not this.
  2. It is tied to novelty. First sight of a weapon, an area, a weather effect, a particular enemy. Walking the same corridor a second time is clean.
  3. It ignores temperature and session length. Thermal problems get worse the longer you play; this gets better.
  4. It returns on a schedule you can name — after a driver update, after a patch, after a cleanup — rather than at random.
  5. The GPU is not the busy part. The compile is CPU work. A GPU sitting well below full occupancy during these hitches is expected here, and is not evidence of the separate problem described in sudden FPS drops in games.

If those five do not describe your symptom, go back to the general list in why games stutter on Windows 11 — the causes there do not fade on their own.

What to do about it

Mostly: let it happen. But there are real choices around the edges.

Do not delete the shader cache as a fix. This is the one piece of advice on this page worth reading twice. Clearing the cache is prescribed constantly as a cure for stutter, and what it actually does is guarantee you pay the full compilation cost again from zero. It is a legitimate troubleshooting step for visual corruption after a driver change. It is the opposite of a performance fix.

Use the game's own pre-compilation step if it offers one, and do not skip it. A game that spends two minutes on a "compiling shaders" screen before the menu is doing exactly this work up front, where it costs you nothing but waiting.

Leave the machine on for a while after a driver update. Some drivers rebuild DirectX 12 shaders while the system is idle, precisely so the runtime does less of it later. That only helps if the machine gets the idle time.

Keep the game and its cache on an SSD, and out of a synchronised folder. A cloud client watches every write, and a game writes its shader cache constantly — every entry becomes filter-driver work plus an upload on the same connection your match is using.

Do not measure inside the window. A capture taken in the first minutes after a driver update measures the compiler, not the driver. Reading the benchmark covers the comparison rules; this is an easy way to break the first one by accident.

What the scan says about it

The stutter scan checks whether a shader cache was cleared recently, and when it finds one it says what this page says: the game recompiles the deleted cache as you play, stutter early in the session is normal and fades on its own, and you should not benchmark until that window has passed.

It is deliberately not presented as a fault to be repaired. There is nothing to repair — there is a cost to be paid once, and the honest thing a tool can do is tell you that you are inside it so you do not spend the evening blaming a setting.

Where it stops being normal

Compilation stutter that never fades is a different problem: the cache is not being kept. Check that the drive is not full, that the cache is not being wiped by a scheduled cleanup between sessions, and that the game folder is not somewhere a cloud client or a size limit keeps clearing.

And if the run is uneven all the way through rather than front-loaded, you are looking at high average FPS but bad 1% lows instead, which is an event problem rather than a warm-up one.

Related

Playing CS2? Which launch options still do anything, and where the frames really are in the video menu: How to fix CS2 stutter and low FPS: a measured checklist

w0a changes no Windows setting until you ask it to, and before a tweak writes a new value it saves the old one. Get notified

Did this page help?

What was missing, or what did not work? We read every one of these.

If this page did not solve it, write to us — say which article you read, and we will fix the article.