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

Metal

-

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

  1. 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).

  2. 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).

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.