Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Bug Shader Dropdown in Material Inspector "Holds" for 1 minute on click

Discussion in '2021.2 Beta' started by Schodemeiss, Feb 22, 2021.

  1. Schodemeiss

    Schodemeiss

    Joined:
    Jan 4, 2018
    Posts:
    43
    When clicked on the Shader dropdown selector in a Material Inspector, I get the "Hold On..." modal appear in the editor for up to a minute, sometimes longer. More often than not, the dropdown never unfolds and I have to click again (and wait for a minute) before I can try again.

    The message says "InspectorWindow.MouseDown".

    This happens with only 2 or 3 shader graphs in my project using URP.
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,948
    Hi!
    How large is you ShaderCache.db file? And how large is the ShaderCache folder?
     
    Schodemeiss likes this.
  3. elZach

    elZach

    Joined:
    Apr 23, 2017
    Posts:
    48
    @aleksandrk i'm not the op, but I also noticed these heavy loadtimes on Shader Dropdown.

    Obviously my project doesn't feature 1000 Shadergraphs - what leads to this extremly bloated shadercache?
    Can I just delete it alongside the shadercache folder? Will it increase to this mammoth size again?

    explorer_W6tNpyDVd3.png
     
    Schodemeiss likes this.
  4. fherbst

    fherbst

    Joined:
    Jun 24, 2012
    Posts:
    802
    Same issue here. Tracing with Visual Studio shows that the slowdown comes from the UI trying to read cached shader errors and that taking forever:

    upload_2021-2-23_16-13-47.png

    Workaround: deleting the ShaderCache.db after closing Unity.

    However, that obviously leads to GIANT build times again as URP and HDRP do their bazillion multi_compile variant compilation dance, so this is clearly not a solution.

    EDIT: As kind of expected, after deleting the ShaderCache.db and doing an Android build the ShaderCache is back, and bigger then before, now at 2.3 GB for me. Same delay again when using the dropdown.
     
    Last edited: Feb 23, 2021
    Schodemeiss and elZach like this.
  5. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,948
    I'd appreciate a bug report on this. Please specify that ShaderCache.db is growing to an insanely large size and tell the QA to not kill it/clear the library folder when they try to reproduce this.
    Thank you!
     
    Schodemeiss likes this.
  6. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,948
    @elZach yes, you can kill it with the ShaderCache folder.
     
    Schodemeiss likes this.
  7. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,948
    fherbst and Schodemeiss like this.
  8. Schodemeiss

    Schodemeiss

    Joined:
    Jan 4, 2018
    Posts:
    43
    Awesome, that seems to have done the job and hopefully the next Alpha will contain the fix. Thanks!
     
  9. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,948