Quick answer
It is safe to delete the DirectX Shader Cache (D3DSCache) and the NVIDIA and AMD shader caches. They hold shaders that the graphics driver compiled for your games, and games compile them again. Expect slower loads or short stutters the first time you play. Clear the DirectX cache with Disk Cleanup (cleanmgr) after you close your games.
On this page
Shader caches are one item in what fills a Windows C: drive. They grow with every game you play, so they can become large on a gaming PC with many games installed.
What a shader cache is
A shader is a small program that runs on the graphics card. A game ships its shaders in a general form, and the graphics driver must compile them for your exact card and driver. Microsoft's DirectX documentation calls this compile step expensive, because it can only happen on your PC at run time.
To avoid that work at every launch, Windows and the graphics drivers save the compiled shaders on disk. The next launch reads them from the cache, so the game loads faster and stutters less.
Microsoft describes D3DSCache as the DirectX Shader Cache component of Windows. Its caches are tied to the program that made them, versioned, and "integrated with disk cleanup". The NVIDIA and AMD drivers keep their own caches next to it.
Where the shader caches are
Microsoft and the graphics card makers do not publish one list of these folders. These are the folders where the caches are usually found, and the ones KemptDesk checks:
%LOCALAPPDATA%\D3DSCache: the DirectX Shader Cache of Windows.%LOCALAPPDATA%\NVIDIA\DXCache: the NVIDIA driver's cache for DirectX games.%LOCALAPPDATA%\NVIDIA\GLCache: the NVIDIA driver's cache for OpenGL games.%LOCALAPPDATA%\AMD\DxCache,%LOCALAPPDATA%\AMD\DxcCacheand%LOCALAPPDATA%\AMD\GLCache: the AMD driver's caches.
%LOCALAPPDATA% is C:\Users\<name>\AppData\Local. To open a folder, press Windows logo key + R, type the path, and select OK. If Windows says it cannot find the folder, that cache is not on your PC.
Game launchers can keep shader caches of their own. Steam, for example, has a Shader Pre-Caching feature. Manage those caches in the launcher's settings, not in its game library folders.
Which shader caches are safe to delete
| Path | What it is | Safe to delete | What happens if you delete it | How to clean it |
|---|---|---|---|---|
%LOCALAPPDATA%\ | DirectX Shader Cache | Yes | Games compile shaders again; first launches load slower | Disk Cleanup > DirectX Shader Cache |
%LOCALAPPDATA%\ | NVIDIA cache for DirectX games | Yes | First launches can stutter while the cache refills | Close games, then delete the files in it |
%LOCALAPPDATA%\ | NVIDIA cache for OpenGL games | Yes | Same as DXCache | Close games, then delete the files in it |
%LOCALAPPDATA%\ | AMD cache for DirectX games | Yes | First launches can stutter while the cache refills | Close games, then delete the files in it |
%LOCALAPPDATA%\ | AMD shader cache | Yes | Same as DxCache | Close games, then delete the files in it |
%LOCALAPPDATA%\ | AMD cache for OpenGL games | Yes | Same as DxCache | Close games, then delete the files in it |
%LOCALAPPDATA%\ | NVIDIA caches and other driver data | Careful | Data other than the caches can be lost | Delete only inside DXCache and GLCache |
Delete the files inside a cache folder, not the AppData or NVIDIA folder around it. The AppData and Temp guide explains why AppData as a whole must stay.
Should you delete it?
Clearing a shader cache gives space back for a while. Games then fill the cache again as you play, so it is not a lasting fix for a full drive.
- Clear it if a game has graphics problems and its support page tells you to clear the cache, or if you need the space now.
- Keep it if your games run well. A full cache is the reason they load without stutter.
Some game publishers' support pages give steps to clear the NVIDIA and DirectX caches as a troubleshooting step. Microsoft's design also lets a cache be versioned by the graphics driver, so after a driver update games build new cache entries.
How to clear the DirectX Shader Cache
Use the tools built into Windows first. Microsoft's documentation says the DirectX caches in temporary storage "can be cleared by disk cleanup".
- Close all games and game launchers.
- In the search box on the taskbar, type Disk Cleanup and select it. You can also press Windows logo key + R and run this command:
cleanmgr /d C:- If Windows asks for a drive, choose C: and select OK.
- In the list, select DirectX Shader Cache. Clear the items you want to keep, such as Recycle Bin.
- Select OK, then Delete Files.
In Settings, select Start > Settings > System > Storage > Temporary files. Select DirectX Shader Cache, clear the other items you want to keep, and select Remove files.
How to clear the NVIDIA and AMD caches
- Close all games, game launchers and graphics tools.
- Press Windows logo key + R, type
%LOCALAPPDATA%\NVIDIA\DXCacheand select OK. - Press Ctrl + A to select everything, then press Delete.
- If Windows says a file is in use, select Skip. A running program still uses it.
- Repeat for
%LOCALAPPDATA%\NVIDIA\GLCache, or for the folders in%LOCALAPPDATA%\AMDon a PC with an AMD card. - Empty the Recycle Bin. Deleted files use space until you do.
AMD's driver app is AMD Software: Adrenalin Edition. If it offers an option to reset the shader cache, you can use that option instead of the steps above.
How to change the NVIDIA shader cache size
NVIDIA's driver settings include a shader cache that is on by default, and a maximum size for the cache on disk. You can change the limit in NVIDIA Control Panel.
- Open NVIDIA Control Panel from the Start menu.
- Select Manage 3D settings, then the Global Settings tab.
- Find Shader Cache Size and pick a smaller or larger limit, or Driver Default.
- Select Apply.
A smaller limit keeps the cache small, but the driver must compile more shaders again. Do not turn the cache off: without it, the driver compiles shaders at every launch.
How KemptDesk handles this
KemptDesk cleans these folders in the System Junk category GPU shader caches: D3DSCache, NVIDIA DXCache and GLCache, and AMD DxCache, DxcCache and GLCache in %LOCALAPPDATA%. They are Safe to clean, but the category is not selected for you, so Smart Care's "Clean recommended" leaves it out until you tick it. Files are deleted directly, not moved to the Recycle Bin, and files in use are skipped. The Browser caches category also clears the shader caches of Chromium browsers. System Junk removes only files inside the cache folders. Hidden space shows %LOCALAPPDATA%\NVIDIA as Check first and never selects it. KemptDesk does not clean game launchers' shader caches or change driver settings.
Questions
Is it safe to delete the DirectX Shader Cache?
Yes. It holds compiled shaders that games can create again. The only cost is slower loads or short stutters the next time you play.
Why do my games stutter after I cleared the shader cache?
The driver must compile each shader again the first time a game needs it. The stutter goes away as the cache fills.
Why does the DirectX Shader Cache come back after Disk Cleanup?
Every game you play adds compiled shaders to the cache again. That is normal, and it is why clearing the cache is not a lasting fix for a full drive.
Should I set the NVIDIA Shader Cache Size to Disabled?
No. Without a cache, the driver compiles shaders at every launch, so games load slower and stutter more. Pick a smaller limit if you need the space.
Should I clear the shader cache after a driver update?
You do not have to. Caches can be versioned by the driver, so games build new entries after an update. Clear the old cache if you want the space back.
Sources
- D3D12 Shader Cache APIs (Microsoft DirectX Specs)
- D3D12_SHADER_CACHE_FLAGS enumeration (Microsoft Learn)
- cleanmgr command (Microsoft Learn)
- Free up drive space in Windows (Microsoft Support)
- NVAPI driver settings: Shader Cache and Shader disk cache maximum size (NVIDIA, GitHub)
- How To Clear Your Shader Cache (WB Games Support)
- How to clear NVIDIA and DirectX cache (Gaijin Support)
- Steam client update adds shader pre-caching (PC Gamer)
- DirectX shader cache (Microsoft Q&A, question wording)
- Question about "Shader Cache Size" in NVIDIA 3D Settings (Tom's Hardware forum, question wording)