Search Issue Tracker
Won't Fix
Won't Fix in 6000.6.X
Votes
0
Found in
2023.2.0a9
6000.0.69f1
6000.3.10f1
6000.4.0b10
6000.5.0a7
6000.6.0a1
Issue ID
UUM-136211
Regression
No
Shader renders whole texture when 'default' is uncommented in 'switch' statement in a script
How to reproduce:
1. Open the “Broken Shader“ project
2. Open the “SampleScene“ scene
3. Make sure build profile is iOS
4. Navigate to Project section and open /Assets/CoolBrokenShader.shader
5. On line 82 uncomment the “default:“ value
6. Enter Play mode
7. Observe the result
Actual result: Whole texture is rendered with triangles
Expected result: Only a certain part is rendered with triangles
Reproducible with: 2023.2.0a9, 6000.0.69f1, 6000.3.10f1, 6000.4.0b10, 6000.5.0a7
Could not test with: 2023.1.0a1 (Shader errors)
Reproducible environment: macOS 26.3 (M1 Max)
Not reproducible environment: No other environments tested
Note: This issue does not occur on macOS/Windows build profile
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
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note:
This looks like the issue with the "speculative execution" when GPU runs both branches and then somehow selects the correct one.
The issue can be easily fixed (and there is a clear warning in shader inspector) by initializing texColor variable explicitly before the switch (or, indeed, adding default: case).
Resolution Note (6000.6.X):
This looks like the issue with the "speculative execution" when GPU runs both branches and then somehow selects the correct one.
The issue can be easily fixed (and there is a clear warning in shader inspector) by initializing texColor variable explicitly before the switch (or, indeed, adding default: case).