arb_program_interface_query: set vs_input2[1][0] as valid name
[piglit.git] / tests / spec / glsl-1.50 / execution / interface-block-struct-nesting.shader_test
bloba51b8b42281fffc386d3f781674a9fe75c8ab28a
1 # This test exercises a particular corner case involving interface
2 # blocks and structs which is broken as of Mesa 975c6ce.
4 # The corner case occurs when an unnamed interface block contains a
5 # struct (or an array of structs), and the struct contains an array.
7 [require]
8 GLSL >= 1.50
10 [vertex shader]
11 struct A {
12   float b[2];
14 out Block {
15   A a;
16   A aa[2];
18 in vec4 piglit_vertex;
20 void main()
22   gl_Position = piglit_vertex;
23   a.b[0] = 1.0;
24   a.b[1] = 2.0;
25   aa[0].b[0] = 3.0;
26   aa[0].b[1] = 4.0;
27   aa[1].b[0] = 5.0;
28   aa[1].b[1] = 6.0;
31 [fragment shader]
32 struct A {
33   float b[2];
35 in Block {
36   A a;
37   A aa[2];
40 void main()
42   bool ok = true;
43   if (a.b[0] != 1.0) ok = false;
44   if (a.b[1] != 2.0) ok = false;
45   if (aa[0].b[0] != 3.0) ok = false;
46   if (aa[0].b[1] != 4.0) ok = false;
47   if (aa[1].b[0] != 5.0) ok = false;
48   if (aa[1].b[1] != 6.0) ok = false;
49   gl_FragColor = ok ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
52 [test]
53 draw rect -1 -1 2 2
54 probe all rgba 0.0 1.0 0.0 1.0