Search Unity

Bug Unity 2021.2 URP build times with shader graph is excessively long, 600k+ variants per shader graph

Discussion in 'Editor & General Support' started by Zeronev, Nov 10, 2021.

  1. Zeronev

    Zeronev

    Joined:
    Jun 26, 2015
    Posts:
    6
    I recently upgraded from 2021.1 because of the new build system, which was supposed to improve iteration builds.

    Basic scene using a custom shader with around 8 nodes used for prototyping, URP 12, lightmapped.
    I am using a single target platform and using DX11.

    Freshly deleted

    First build took 3 hours (expected, maybe?)
    If I make a single change to the scene, like moving an object to another position and rebuild it, it takes around 15 minutes, every single time.
    This is really bad for checking and fixing bugs if the game is networked (I am using Mirror, so I need to be able to build and test really quickly).

    I attached a screenshot on what takes the most time.
    It is not compiling shaders, its "stripping fragment programs" , and it takes way too long.
    Per shader graph in the project, it takes around 2-4 minutes per shader, making it actually impossible to use shaders made with the shader graph, even if I made a single change in a scene.
     

    Attached Files:

  2. Zeronev

    Zeronev

    Joined:
    Jun 26, 2015
    Posts:
    6