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
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
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
- Error when adding valid MonoBehaviour script to Prefab in Project window
- Editor Launch Screen will close when Enter is pressed on it
- ObjectPool's pool is destroyed when entering Play Mode without reloading Domain
- [Android] Permission window is not shown when using a Build App Bundle (Google Play) with Minify set to Release
- NullReferenceException errors appear in the Console and Inspector window turns black when dragging .cs and .uxml files to another directory
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