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
- GC.Alloc called by HDRenderPipeline.LensFlareMergeOcclusionDataDrivenPass() when playing the default HDRP Sample Template project
- Automatic LOD fails and SRP Batcher incompatibility occurs when using spline-based quad-topology meshes
- Editor crashes on D3D12GetInterface when repeatedly enabling and disabling 256 text components
- Flickering bright white dots in the Scene when the Android Platform is selected and DX11 Graphics API is used with Iris(R) Xe Graphics GPU
- Inconsistent capitalization and misaligned text in multiple query blocks in Search window
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