Search Issue Tracker
Fixed in 2022.2.X
Votes
4
Found in
2019.4
2020.3
2020.3.25f1
2021.2
2022.1
2022.2
Issue ID
1394682
Regression
No
"Shader not supported on this GPU" error is thrown when stripping a Shader that calls the UsePass command
How to reproduce:
1. Open the user's attached "UsePassStripping" project
2. Build and Run the "SampleScene" Scene
3. Observe the Cubes in the Player
Expected result: Both Cubes are white
Actual result: The left-side Cube is pink. In the Player.logs can be seen, that "ERROR: Shader BugReport/ShaderUsePass shader is not supported on this GPU (none of subshaders/fallbacks are suitable)" is thrown
Reproducible with: 2019.4.35f1, 2020.3.28f1, 2021.2.11f1, 2022.1.0b7, 2022.2.0a3
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
- Render Pipeline Converter selected asset counter reports one fewer item when using manual selection
- [Android] [Adreno] [WebGL] A light cookie is not rendered with shader compile error when WebGL build is launched on a device with Adreno GPU
- Rigibody sliding over a flat surface that is made of several GameObjects detects false collisions when Collision Detection is set to "Continuous" or "Continuous Dynamic"
- UI Toolkit Label height is incorrectly calculated when using max-width with percentage value
- Visual Effect Material causes Scene view to update continuously when both Scene and Game views are open, despite "Always Refresh" being disabled
Resolution Note (fix version 2022.2):
This seems to be working as intended.
If a use pass fails to find the used shader pass then the entire sub-shader is intentionally removed.
If you're trying to do a fallback mechanism, you should be using sub-shaders, not passes. All passes will end up running (in this case, the 1st one runs and sets the color to red then the 2nd one runs and overwrites that to white). You can get a similar effect to your example by moving each pass to a sub-shader (same for the use passes). When you do this, the first sub-shader will run, but when you strip the pass the 2nd sub-shader will run for both shaders.
If you're attempting to use this to achieve some variant behavior, then we'd recommend using other solutions, such as preprocessor directives.