Search Issue Tracker

By Design

Votes

0

Found in

2019.4

2020.3

2020.3.31f1

2021.3

2022.1

2022.2

Issue ID

1415608

Regression

No

No error or warning thrown when compiling a shader with a comma instead of a period in code

Shader System

-

Reproduction steps:
1. Open the attached project "1415608.zip"
2. Open "SampleScene"
3. Edit line 43 of NewSurfaceShader.shader to "fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color,gbra;" and save the change
4. Return to Unity

Expected result: An error or a warning is thrown and the cube changes color to white
Actual result: Shader compiles and the cube changes color to red

Reproducible with: 2019.4.38f1, 2020.3.34f1, 2021.3.1f1, 2022.1.0f1, 2022.2.0a11

Note: Not reproducible with the following symbols: ; / ' * : -

  1. Resolution Note (2022.2.X):

    This is legal hlsl syntax. The ',' operator can be used to separate multiple expressions (https://docs.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-operators#comma-operator). In this case, this is effectively the same as saying
    ```
    fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color;
    fixed4 gbra;
    ```

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.