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
- Crash on D3D12CommonShader::ApplyGpuProgram when attaching material which samples "_UnityFBInput0" to "Full Screen Pass Renderer Feature" Component
- SpeedTree meshes and objects count differs when comparing the numbers in the Player with the Editor
- Model and Prefab Preview icons are not updated after upgrading associated Materials to URP
- Game view is rendered white when viewing the Editor with HDR display and Post Proccesing is enabled on the Main Camera with 2D URP
- "GetPreferedValue" returns max value when using auto-sizing
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