If you attempt to create a player build of a project with URP shaders in the scene, but have no render pipeline set in any of the available quality settings, none of the variants in the URP shaders get filtered, thus resulting in the editor attempting to compile many billions of shader variants.
Steps to reproduce:
- Create a new URP project
- Add a cube to the scene
- Make sure it is using the URP/Lit material
- Under Project Settings / Quality:
- Delete all but one quality level
- Set the render pipeline asset for the remaining quality level to None
- Delete all render pipeline assets from the project
- Make a player build of the project
Actual results:
The editor may appear to hang when it begins preparing shaders. The build will end up taking several hours, showing many billions of shader variants being prepared for the URP/Lit shader, but will usually crash at some point due to running out of memory.
Expected results: Build finishes in sane time
Reproducible with versions: All versions, tested as far back as 2022.3.62f3
Not reproducible with versions: N/A
Can’t test with versions: N/A
Tested on (OS): Windows (x64), macOS (M4)
Notes:
- There have been many bugs reported referencing a shader-related crash in core::hash_set<>, but upon debugging and checking their project settings, they may be duplicates of each other with this bug being the root cause.