PC Optimization #shader cache#GPU optimization#Windows 11

GPU Shader Cache: What It Is and When to Clear It

Understand GPU shader caches on NVIDIA, AMD, and DirectX, how they affect game performance, and when clearing them fixes stuttering.

5 min read

Shader caches store compiled GPU programs (shaders) so games don’t have to recompile them every time they load. A healthy shader cache means faster game loads and fewer stutters. A corrupted or oversized cache can cause the opposite. Here’s what you need to know.

What Is a Shader Cache?

When a game runs for the first time, it compiles GLSL/HLSL shader source code into GPU-native binary code. This compilation takes time — it’s why new games stutter on first play. The compiled result is saved to disk as a shader cache. Subsequent runs skip compilation and load the precompiled binary directly.

Modern games and APIs have multiple cache layers:

  • Game-side cache: stored in game data folders or AppData
  • DirectX Shader Cache: Windows-managed, stored in your temp/appdata
  • NVIDIA Shader Cache: stored in AppData\Local\NVIDIA\DXCache and GLCache
  • AMD Shader Cache: stored in AppData\Local\AMD\DxCache
  • Vulkan Pipeline Cache: per-game pipeline cache files

Where Shader Caches Are Stored

# DirectX (Windows)
C:\Users\%USERNAME%\AppData\Local\D3DSCache

# NVIDIA DX cache
C:\Users\%USERNAME%\AppData\Local\NVIDIA\DXCache

# NVIDIA GL cache
C:\Users\%USERNAME%\AppData\Local\NVIDIA\GLCache

# AMD shader cache
C:\Users\%USERNAME%\AppData\Local\AMD\DxCache

These folders can grow to several gigabytes over time.

When to Clear Shader Caches

Clear your shader cache if you experience:

  • New stutters after a driver update (stale cache is incompatible with new driver)
  • Crashes on game launch after updating a game
  • Corrupted visuals or missing textures in a specific game
  • Game refuses to load after a patch

Don’t clear shader caches if everything is working fine — you’ll just trigger recompilation stutters on next launch.

How to Clear Shader Caches

Windows DirectX Shader Cache

  1. Disk Cleanup (cleanmgr.exe) → select your C: drive → check DirectX Shader Cache → OK
  2. Or delete manually: C:\Users\%USERNAME%\AppData\Local\D3DSCache

NVIDIA Cache

In NVIDIA Control Panel → Manage 3D Settings → Shader Cache Size dropdown → click Clear button (if available). Or delete the DXCache and GLCache folders manually.

Alternatively:

Remove-Item "$env:LOCALAPPDATA\NVIDIA\DXCache" -Recurse -Force
Remove-Item "$env:LOCALAPPDATA\NVIDIA\GLCache" -Recurse -Force

AMD Cache

Remove-Item "$env:LOCALAPPDATA\AMD\DxCache" -Recurse -Force

Steam also has a shader cache per-game:

  1. Steam → Library → right-click game → Properties
  2. Local Files tab → Browse to game folder
  3. Look for a shadercache folder and delete it

NVIDIA Shader Cache Size Setting

NVIDIA Control Panel → Manage 3D Settings → Shader Cache Size:

  • Default: Driver Default (varies, usually 4GB)
  • For gaming: set to 10 GB to prevent frequent cache evictions
  • For workstations with many apps: set to Unlimited (capped by disk space)

A larger cache means fewer recompilation events over time.

Steam Shader Pre-Compilation

Steam pre-compiles Vulkan shaders for many games in the background (you’ll see it in the download section). Let this complete before playing for the smoothest first session. You can check progress in Steam → Downloads.

Driver Updates and Cache Invalidation

After a major GPU driver update, Windows and your GPU driver automatically invalidate stale caches. You’ll see compilation stutters in the first hour of gaming after a driver update — this is normal. After that session, caches rebuild and stuttering returns to baseline.

If stutters persist beyond the first session after a driver update:

  1. Use DDU to do a clean driver install
  2. Clear all shader caches manually
  3. Reinstall the driver fresh

Disk Space Considerations

Shader caches can accumulate several GB over time if you play many different games. Run Disk Cleanup monthly and include DirectX Shader Cache. The performance cost of regenerating caches is a one-time 15–30 minutes of mild stuttering — worth the disk space recovery on smaller SSDs.

#gaming performance #Windows 11 #GPU optimization #shader cache