arb_program_interface_query: set vs_input2[1][0] as valid name
[piglit.git] / tests / spec / glsl-1.50 / execution / variable-indexing / gs-input-array-float-index-rd.shader_test
blob8fc28c4ada2f92ffbd9a547ab15a058a867fc05c
1 [require]
2 GLSL >= 1.50
3 GL_MAX_VERTEX_OUTPUT_COMPONENTS >= 128
5 [vertex shader]
6 #version 150
8 in vec4 piglit_vertex;
10 out block {
11   float m1[16];
12   float m2[15];
13 } ins;
15 void main()
17     gl_Position = piglit_vertex;
19     for (int i = 0; i < ins.m1.length(); i++)
20         ins.m1[i] = float(1+i);
22     for (int i = 0; i < ins.m2.length(); i++)
23         ins.m2[i] = float(1+ins.m1.length()+i);
26 [geometry shader]
27 #version 150
28 layout(triangles) in;
29 layout(triangle_strip, max_vertices = 3) out;
31 uniform int index;
32 uniform vec4 expect;
33 in block {
34     float m1[16];
35     float m2[15];
36 } ins[];
37 out vec4 color;
39 void main()
41     for (int p = 0; p < 3; p++) {
42         color = ((index >= ins[p].m1.length() ? ins[p].m2[index-ins[p].m1.length()]
43                               : ins[p].m1[index]) == expect.x)
44             ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
46         gl_Position = gl_in[p].gl_Position;
47         EmitVertex();
48     }
51 [fragment shader]
52 #version 150
53 in vec4 color;
54 out vec4 outcolor;
56 void main()
58     outcolor = color;
61 [test]
62 clear color 0.5 0.5 0.5 0.5
63 clear
65 uniform int index 0
66 uniform vec4 expect 1 1.1 1.2 1.3
67 draw rect -1 -1 0.09 0.09
68 probe rgb 6 6 0.0 1.0 0.0
70 uniform int index 1
71 uniform vec4 expect 2 2.1 2.2 2.3
72 draw rect -0.9 -1 0.09 0.09
73 probe rgb 18 6 0.0 1.0 0.0
75 uniform int index 2
76 uniform vec4 expect 3 3.1 3.2 3.3
77 draw rect -0.8 -1 0.09 0.09
78 probe rgb 31 6 0.0 1.0 0.0
80 uniform int index 3
81 uniform vec4 expect 4 4.1 4.2 4.3
82 draw rect -0.7 -1 0.09 0.09
83 probe rgb 43 6 0.0 1.0 0.0
85 uniform int index 4
86 uniform vec4 expect 5 5.1 5.2 5.3
87 draw rect -0.6 -1 0.09 0.09
88 probe rgb 56 6 0.0 1.0 0.0
90 uniform int index 5
91 uniform vec4 expect 6 6.1 6.2 6.3
92 draw rect -0.5 -1 0.09 0.09
93 probe rgb 68 6 0.0 1.0 0.0
95 uniform int index 6
96 uniform vec4 expect 7 7.1 7.2 7.3
97 draw rect -0.4 -1 0.09 0.09
98 probe rgb 81 6 0.0 1.0 0.0
100 uniform int index 7
101 uniform vec4 expect 8 8.1 8.2 8.3
102 draw rect -0.3 -1 0.09 0.09
103 probe rgb 93 6 0.0 1.0 0.0
105 uniform int index 8
106 uniform vec4 expect 9 9.1 9.2 9.3
107 draw rect -0.2 -1 0.09 0.09
108 probe rgb 106 6 0.0 1.0 0.0
110 uniform int index 9
111 uniform vec4 expect 10 10.1 10.2 10.3
112 draw rect -0.1 -1 0.09 0.09
113 probe rgb 118 6 0.0 1.0 0.0
115 uniform int index 10
116 uniform vec4 expect 11 11.1 11.2 11.3
117 draw rect 0 -1 0.09 0.09
118 probe rgb 131 6 0.0 1.0 0.0
120 uniform int index 11
121 uniform vec4 expect 12 12.1 12.2 12.3
122 draw rect 0.1 -1 0.09 0.09
123 probe rgb 143 6 0.0 1.0 0.0
125 uniform int index 12
126 uniform vec4 expect 13 13.1 13.2 13.3
127 draw rect 0.2 -1 0.09 0.09
128 probe rgb 156 6 0.0 1.0 0.0
130 uniform int index 13
131 uniform vec4 expect 14 14.1 14.2 14.3
132 draw rect 0.3 -1 0.09 0.09
133 probe rgb 168 6 0.0 1.0 0.0
135 uniform int index 14
136 uniform vec4 expect 15 15.1 15.2 15.3
137 draw rect 0.4 -1 0.09 0.09
138 probe rgb 181 6 0.0 1.0 0.0
140 uniform int index 15
141 uniform vec4 expect 16 16.1 16.2 16.3
142 draw rect 0.5 -1.0 0.09 0.09
143 probe rgb 193 6 0.0 1.0 0.0
145 uniform int index 16
146 uniform vec4 expect 17 17.1 17.2 17.3
147 draw rect -1 -0.9 0.09 0.09
148 probe rgb 6 18 0.0 1.0 0.0
150 uniform int index 17
151 uniform vec4 expect 18 18.1 18.2 18.3
152 draw rect -0.9 -0.9 0.09 0.09
153 probe rgb 18 18 0.0 1.0 0.0
155 uniform int index 18
156 uniform vec4 expect 19 19.1 19.2 19.3
157 draw rect -0.8 -0.9 0.09 0.09
158 probe rgb 31 18 0.0 1.0 0.0
160 uniform int index 19
161 uniform vec4 expect 20 20.1 20.2 20.3
162 draw rect -0.7 -0.9 0.09 0.09
163 probe rgb 43 18 0.0 1.0 0.0
165 uniform int index 20
166 uniform vec4 expect 21 21.1 21.2 21.3
167 draw rect -0.6 -0.9 0.09 0.09
168 probe rgb 56 18 0.0 1.0 0.0
170 uniform int index 21
171 uniform vec4 expect 22 22.1 22.2 22.3
172 draw rect -0.5 -0.9 0.09 0.09
173 probe rgb 68 18 0.0 1.0 0.0
175 uniform int index 22
176 uniform vec4 expect 23 23.1 23.2 23.3
177 draw rect -0.4 -0.9 0.09 0.09
178 probe rgb 81 18 0.0 1.0 0.0
180 uniform int index 23
181 uniform vec4 expect 24 24.1 24.2 24.3
182 draw rect -0.3 -0.9 0.09 0.09
183 probe rgb 93 18 0.0 1.0 0.0
185 uniform int index 24
186 uniform vec4 expect 25 25.1 25.2 25.3
187 draw rect -0.2 -0.9 0.09 0.09
188 probe rgb 106 18 0.0 1.0 0.0
190 uniform int index 25
191 uniform vec4 expect 26 26.1 26.2 26.3
192 draw rect -0.1 -0.9 0.09 0.09
193 probe rgb 118 18 0.0 1.0 0.0
195 uniform int index 26
196 uniform vec4 expect 27 27.1 27.2 27.3
197 draw rect 0 -0.9 0.09 0.09
198 probe rgb 131 18 0.0 1.0 0.0
200 uniform int index 27
201 uniform vec4 expect 28 28.1 28.2 28.3
202 draw rect 0.1 -0.9 0.09 0.09
203 probe rgb 143 18 0.0 1.0 0.0
205 uniform int index 28
206 uniform vec4 expect 29 29.1 29.2 29.3
207 draw rect 0.2 -0.9 0.09 0.09
208 probe rgb 156 18 0.0 1.0 0.0
210 uniform int index 29
211 uniform vec4 expect 30 30.1 30.2 30.3
212 draw rect 0.3 -0.9 0.09 0.09
213 probe rgb 168 18 0.0 1.0 0.0
215 uniform int index 30
216 uniform vec4 expect 31 31.1 31.2 31.3
217 draw rect 0.4 -0.9 0.09 0.09
218 probe rgb 181 18 0.0 1.0 0.0