Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Feedback Any change to a shader makes Unity unresponsive for minutes (shader cache)

Discussion in 'Editor & General Support' started by TSWessel, Nov 27, 2020.

  1. TSWessel

    TSWessel

    Joined:
    Mar 14, 2016
    Posts:
    5
    Every time I made the slightest change to any shader, created a new empty shader, or duplicated an existing shader, I had to wait. Also, the problem slowly worsened over time.

    I eventually found that the solution was to delete the shader cache (Library > ShaderCache) which had grown stupidly large. But by that time it had probably already cost me several hours of waiting combined.

    Perhaps it would be a good idea to be able to set a maximum size or a time limit for shader cache files in Unity's preferences to prevent this behavior. It kind of defeats the purpose of having a cache if it starts slowing things down instead of speeding things up.
     
    Last edited: Nov 27, 2020
    TimHeijden2 likes this.
  2. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    1,296
    I ran into the same issue after upgrading a large project to Asset Database v2, and indeed the shader cache was about 9GB and needs to be periodically deleted. Making even the smallest change to a shader prompted a literal 5 minute wait.
     
unityunity