Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug Synchronous Shader Compilation slow / bugged in 2022?

Discussion in 'Shaders' started by AcidArrow, Aug 17, 2023.

  1. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,988
    Why is synchronous shader compilation so slow and distracting in 2022? There didn't use to be a pop up and the editor would maybe miss a frame or two and then it'd be done. Now there are a bunch of pop ups and the whole process takes like 10x more time and is super distracting.



    The video is with the first LTS but the issue hasn't changed as of .7.
     
  2. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,055
    Hi!
    Which render pipeline are you using?
     
  3. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,988
    Built in.
     
  4. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,055
    Would it be possible for you to create a bug report? I'd like to check what's going on there.
     
  5. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,988
    I did, a couple of months ago, but I didn't want to upload the whole project, so I submitted without a repro and apparently the video and the logs weren't enough and the bug was closed.

    I'm using all custom vert frag shaders, haven't had this issue with 2021. When 2021 loads the shaders, it maybe hitches for 1 frame, if that (and there's no pop up) so the experience is much smoother.

    I'll see if I can find the time on the weekend to do a minimal repro.
     
    aleksandrk likes this.
  6. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,988
    I just submitted a bug report, it's IN-53978

    Here is a comparison video 2021 vs 2022 in a minimal repro scene:


    I guess we can work around this one by enabling async shader compilation, but I find the cyan color the objects have while loading far more distracting than the minimal hitch 2021 has (and also the hitch behaviour is closer to what happens when built on a device, so I don't know what I'm gaining by async shader compilation in the editor).

    In any case, I fully expect QA will not be able to reproduce, which is fine, we are probably going to skip 2022, it would be nice if some of these issues were fixed for 2023 though.
     
    Last edited: Sep 6, 2023
    aleksandrk likes this.
  7. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,055
    Please report back when you get a reply from them.
    Thank you!
     
  8. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,988
    I'm starting to think this is an "if" and not a "when"...
     
  9. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,055
    Let me try and poke Customer QA :)
     
    AcidArrow likes this.
  10. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,988
  11. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,988
    So I am playing around with the URP sample scene and moving around makes things hang and stutter, I feel like shader compilation has become many times slower in 2022 (and 2023). I thought it had to do with my own shaders somehow, but it seems even worse with URP stuff.
     
  12. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,988
    I mean, is this how it is for everyone? This makes using and testing in the editor very frustrating.

     
  13. WildStyle69

    WildStyle69

    Joined:
    Jul 20, 2016
    Posts:
    319
    This is driving me nuts - on Windows 10 some of the shaders compile every time I play the game in the 2022 editor and then again when I stop play. Models go blue, FPS tanks. TLS errors in the console. It's a mess and really makes testing in the editor a nightmare.

    2021 was just fine, it seemed to cache the shaders, but in 2022 it just keep recompiling them all the time.

    // Wildstyle
     
  14. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    3,055
    @WildStyle69 It would be great if you could file a bug report. It looks different from what was discussed here.