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
- Fixing Message Loss in UMPE During Domain Reload
- The Editor freezes when ScheduleReadOnly of IJobParallelForTransform with dependency is used
- Text is truncated in the Inspector when the display scale is set to 150%
- CancellationTokenSource(<timeout>) has incorrect cancellation status when used in WebGL Player
- VFX property value names are cut off when properties with 'Arc' are viewed in the VFX Blackboard
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