Search Issue Tracker

By Design

Votes

0

Found in

2017.4.0f1

2018.2.8f1

2018.3.0a1

2019.1.0a1

2019.2.0a1

Issue ID

1123373

Regression

No

Surface Shader won't compile and gives compiler error when placing a multidimensional array in the global scope

Shaders

-

How to reproduce:
1. Open the project "case_1123373-ShaderArrrayBug_1" and scene "SampleScene"
2. Inspect the materials in the scene

Expected result: both spheres appear properly lit
Actual result: the sphere on the right is white (it uses a Surface Shader)

Reproducible with: 2017.4.20f2, 2018.3.6f1, 2019.1.0b3, 2019.2.0a6

Note: this issue is caused by placing a line with a multidimensional int array in the global scope of a surface shader. The issue is not present when writing the same line in the global scope of an equivalent vertex/fragment shader

  1. Resolution Note:

    Surface shader doesn't recognise some of the HLSL syntax so you will have to wrap the code with:
    #if defined (UNITY_COMPILER_HLSL) && SHADER_API_D3D11
    //your problematic code
    #endif

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.