1 // Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
2 // includes the following examples of compile-time errors:
4 // // code sequence within one shader...
5 // in vec4 Color1[]; // size unknown
6 // ...Color1.length()...// illegal, length() unknown
7 // in vec4 Color2[2]; // size is 2
8 // ...Color1.length()...// illegal, Color1 still has no size
9 // in vec4 Color3[3]; // illegal, input sizes are inconsistent
10 // layout(lines) in; // legal, input size is 2, matching
11 // in vec4 Color4[3]; // illegal, contradicts layout
12 // ...Color1.length()...// legal, length() is 2, Color1 sized by layout() (*)
13 // layout(lines) in; // legal, matches other layout() declaration
14 // layout(triangles) in;// illegal, does not match earlier layout() declaration
16 // This test verifies the case marked with (*), namely that it is
17 // legal to call .length() on an unsized geometry shader input array,
18 // if an input layout declaration occurs between the declaration of
19 // the input and the call to .length().
22 // expect_result: pass
33 uniform int foo[Color1.length() == 2 ? 1 : -1];