Search Issue Tracker
Fixed
Fixed in 2021.3.15f1, 2022.2.0b15, 2023.1.0a14
Votes
113
Found in
2021.3.8f1
2022.1.13f1
2022.2.0b4
2023.1.0a6
Issue ID
UUM-3711
Regression
No
Shader variant build preparation does not scale
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.
-
enricdelgadoclaramunt
Oct 25, 2022 10:06
it's about time, please fix this!
-
Kalanord
Oct 24, 2022 13:57
backport fix to 2021.3 LTS pls
-
AlexGuerreroXantal
Oct 24, 2022 13:51
Backport the fix to 2021.3 LTS.
-
MaxRadice
Oct 24, 2022 13:49
Please backport the fix to 2021.3 LTS.
-
MarcPalenzuelaReyes
Oct 21, 2022 07:49
Please fix this!
-
WildStyle69
Oct 18, 2022 12:10
Crazy stuff, 16 hours+ of shader variants with URP so far... please fix this!
-
fortunacio
Oct 16, 2022 22:58
Come on guys! fix this sht!
-
tspk91
Oct 05, 2022 07:22
Please backport the fix to 2021.3 LTS. This almost doubles build times for us, dwarfing shader compilation itself.
-
hellno2015
Sep 22, 2022 01:02
Sorry meant 32 GB RAM
-
hellno2015
Sep 21, 2022 23:59
kay I am not a tech wiz but I am guessing this means the building time takes longer then it should, especially in URP. I had a look for the release notes of 2022.1.16 and the problem isn't even mentioned so I don't know if that means it's fixed or not.
I tested the build times of 2022.1.16 and the URP sample scene took about 4 minutes and the HDRP sample scene took about 6:30 minutes.
Don't know if theses are what the times should be or not, just wanted to share this information.
Also my specs are: RTX 3050, I7 1280P and 36GB RAM
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- [Android ] "AndroidJNI.ToBooleanArray" returns a random non-zero value instead of "IntPtr.Zero" when the method argument is null
- Non-HDR color picker opens when selecting material color with HDR enabled
- Crash on EditorApplication:Internal_CallUpdateFunctions when pushing property block by index to SpriteShapeRenderer
- Depth Texture Mode "After Opaques" breaks when "Full Screen Pass Renderer Feature" is added
- The Code Previews panel is initially opened in a slightly minimized state
Resolution Note (fix version 2023.1.0a14):
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.
Resolution Note (fix version 2022.2.0b15):
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.
Resolution Note (fix version 2021.3.15f1):
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.