Unity Issue Tracker - Shader variant build preparation does not scale
Fixed
UUM-3711
Shader variant build preparation does not scale
Unity: Shader System
Fixed
2023.1.X
2022.2.X
2021.3.X
Won't Fix
2022.1.X
2021.2.X
Added a shader keyword pre-filtering system to avoid enumerating through the full variant space. Utilized by URP only for starters.
This makes the build faster again by avoiding processing millions of variants just to be stripped.
Added a shader keyword pre-filtering system to avoid enumerating through the full variant space. Utilized by URP only for starters.
This makes the build faster again by avoiding processing millions of variants just to be stripped.
Resolved in 22.2
Added a shader keyword pre-filtering system to avoid enumerating through the full variant space. Utilized by URP only for starters.
This makes the build faster again by avoiding processing millions of variants just to be stripped.
Closing since this version is not supported anymore, and there is another port to track 2021.3 which is the supported version
When building shaders Unity enumerates through all possible shader variants to be able to strip the excess variants using scriptable stripping. With the amount of multi_compile features increasing in the shaders, the full variant space can grow into sizes where the time and memory requirements to process becomes unbearable.
URP is especially hurt by this due to how much it utilizes multi_compile. Take the URP template project and build it. A significant portion of the time goes into preparing 400M variants, after which we only compile the required ones. Now add a few multi_compiles on top of that and the preparation can take hours.
Prioritise and Follow this issue
Have a workaround or additional info about this issue?