2 // array size from initializer
3 static float g_array [ ] = { 1, 2, 3, 4, 5 };
5 // Unused: array size from initializer
6 static float g_array_unused [ ] = { 1, 2, 3, 4, 5, 6, 7 };
8 // Test initializer sizing for arrayed structs
9 static struct mystruct {
17 struct PS_OUTPUT { float4 color : SV_Target0; };
19 // INVALID: implicit size requires an initializer expression.
20 // uniform float bad[];
22 // INVALID: function parameters cannot be implicitly sized
23 // void BadFunction(int a[]) { }
25 void main(out PS_OUTPUT ps_output)
27 // local array sized from initializers
28 float l_array[] = { 1, 2, 3 };
31 ps_output.color = g_array[0] + g_array[4] + l_array[1] + g_mystruct[0].f + g_array[idx];