Search Issue Tracker

Won't Fix

Votes

0

Found in

2021.3.36f1

2022.3.21f1

2023.2.14f1

6000.0.0b11

6000.1.0a7

7000.0.0a1

Issue ID

UUM-66442

Regression

No

[Silicon] Artifacts are visible in a shader when it has a dither pattern

-

Reproduction steps:
1. Open the attached “ReproProj” project
2. Open the “Assets/Scenes/SampleScene.unity” Scene
3. Observe the Game view

Expected result: All materials in the Game view are clearly visible
Actual result: The “Sphere” GameObject has artifacts

Reproducible with: 2021.3.36f1, 2022.3.21f1, 2023.2.14f1, 6000.0.b11

Reproducible on: macOS 14.3.1 (M1 Max)
Not reproducible on: macOS 13.6.4 (Intel)

Note: The issue is more visible when zooming in/out

  1. Resolution Note:

    Alas, this seems to be a quite low-level issue inside drives with register allocation in the case of the non-uniform control flow (due to discard)

    There are, though, two quite easy workarounds:
    1. change `float DITHER_THRESHOLDS[16]` to be `const float DITHER_THRESHOLDS[16]` (or, more generally, make readonly array const indeed). This will move the initialization from runtime to "compiler, here is const data, please do something"; compiler seem to do the right thing

    2. add `#pragma use_dxc metal` to the shader in question - dxc is WAY better at generating the code for filling float array used in the shader (in repro project), making it actually float1 and const

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.