User Agents

Web browsers and everyday web tech, explained

How to Clear DirectX Shader Cache (Step-by-Step)

· 5 min read · Cookies and Cache

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Clearing the DirectX shader cache removes temporary compiled shader files that games and apps store on your drive. This can fix graphical glitches, stuttering, or crashes after a driver update, and it can free up disk space. You don't need any special tools—just Windows' built-in Disk Cleanup or the Settings app. Here's exactly how to do it.

What You'll Need

  • A Windows PC (Windows 10 or Windows 11).
  • Administrator access to your user account (you'll be deleting files from system folders).
  • Optional: a third-party tool like CCleaner, but it's not required.

Step-by-Step

  1. Close all running games and graphics-heavy apps. This ensures no shader cache files are in use, which could cause the deletion to fail or leave corrupted files behind.
  2. Open Disk Cleanup. Press Windows + S, type Disk Cleanup, and press Enter. If you have multiple drives, select the drive where your games and Windows are installed (usually C:).
  3. Click "Clean up system files." This button is at the bottom-left of the Disk Cleanup window. It will ask for administrator permission—click Yes if prompted.
  4. Wait for the scan to finish. Disk Cleanup will recalculate how much space can be freed. This may take a minute or two.
  5. Check the "DirectX Shader Cache" box. Scroll through the list of files to delete. Look for "DirectX Shader Cache" (it might be listed under "Files to delete"). Make sure the checkbox next to it is ticked. You can also check other items like "Temporary files" if you want, but for this task, focus on the shader cache.
  6. Click OK, then Delete Files. A confirmation dialog will appear. Click "Delete Files" to start the cleanup. This may take a few seconds to a few minutes depending on how much cache you've accumulated.
  7. Alternatively, use Windows Settings (Windows 11). Go to Settings > System > Storage > Cleanup recommendations (or Temporary files in Windows 10). Wait for the scan, then check "DirectX Shader Cache" and click "Clean up."
  8. Restart your PC. After the cleanup, restart your computer to ensure all cached data is flushed from memory and the system rebuilds a fresh cache on next game launch.

Common Mistakes

  • Not closing games first. If a game is still running, some shader cache files may be locked, and Disk Cleanup might skip them or partially delete them, causing issues.
  • Deleting the wrong folder manually. Some guides tell you to delete the contents of C:\Users\[YourName]\AppData\Local\D3DSCache manually. This can work, but if you delete while a game is running, you risk corruption. Stick to Disk Cleanup for safety.
  • Clearing the cache too often. The shader cache is there to improve performance by precompiling shaders. Clearing it every day will cause games to recompile shaders, leading to stuttering on first launch. Only clear it when you have a specific problem.

Tips

  • Know the difference: DirectX Shader Cache vs. GPU driver cache. Disk Cleanup's "DirectX Shader Cache" is separate from your graphics driver's own cache (e.g., NVIDIA's DXCache or AMD's GLCache). If you're having driver-specific issues, you may also want to clear those—but that's a different process.
  • Use Disk Cleanup over third-party tools. It's built-in, safe, and does exactly what you need without extra bloat.
  • After clearing, launch a game once to rebuild the cache. The first launch after clearing will take longer and may stutter as shaders are recompiled. That's normal—let it finish.
  • If you're low on disk space, also check "Temporary Files" and "Delivery Optimization Files" in Disk Cleanup. These can be large and are safe to delete.

Troubleshooting

  • Disk Cleanup doesn't show "DirectX Shader Cache." This can happen if you haven't run any DirectX apps recently, or if the cache is empty. Try launching a game or a DirectX diagnostic tool (like dxdiag) and then run Disk Cleanup again.
  • The cleanup process hangs or takes forever. This is rare but can happen if there are many small files. Wait it out; if it's stuck for more than 10 minutes, close Disk Cleanup, restart your PC, and try again.
  • Games still stutter after clearing. If the stuttering persists, the issue might not be the shader cache. Check your graphics driver updates, game settings, or disk health.
  • You can't find the Settings option on Windows 10. In Windows 10, go to Settings > System > Storage > Temporary files. If you don't see "DirectX Shader Cache" there, use Disk Cleanup as described.
  • Accidentally deleted other files. Disk Cleanup only deletes files you explicitly check. If you unchecked everything except DirectX Shader Cache, you're fine. If you're unsure, you can restore from your recycle bin if they were deleted there—but Disk Cleanup deletes permanently, so be careful.

Frequently Asked Questions

What exactly is the DirectX shader cache?

It's a collection of compiled shader files that DirectX creates when you run games or graphics-intensive applications. These files are stored locally so that the next time you launch the same app, it doesn't have to recompile them, which speeds up loading times and reduces stuttering.

Is it safe to delete the DirectX shader cache?

Yes, it's completely safe. Windows will automatically rebuild the cache the next time you run a DirectX application. You won't lose any game data or settings—just a temporary performance boost that will be regenerated.

How often should I clear the DirectX shader cache?

Only when you're experiencing issues like graphical glitches, crashes, or stuttering that you suspect are related to corrupted cache files. There's no need to clear it on a regular schedule.

Will clearing the shader cache affect my game save files?

No. Shader cache files are separate from your game saves. Deleting them won't touch your progress or settings.

Can I clear the shader cache manually by deleting the folder?

Yes, you can delete the contents of C:\Users\[YourName]\AppData\Local\D3DSCache manually, but it's safer to use Disk Cleanup because it handles locked files properly. If you do it manually, make sure no games are running.

Does clearing the shader cache improve FPS?

Not directly. It can fix stuttering caused by corrupted cache, but it won't boost your maximum FPS. In fact, you may see a temporary FPS drop right after clearing because your system has to rebuild the cache.