1 group if "If Statements"
6 input float in0 = [ 0.0 | 1.0 | 2.0 ];
7 output float out0 = [ 0.0 | 1.0 | 1.0 ];
11 precision mediump float;
23 case compound_statement
26 input float in0 = [ 0.0 | 1.0 | 2.0 ];
27 output float out0 = [ 0.0 | 1.0 | 1.0 ];
28 output float out1 = [ 1.0 | 0.0 | 0.0 ];
32 precision mediump float;
48 case sequence_statements
51 input float in0 = [ 0.0 | 1.0 | 2.0 ];
52 output float out0 = [ 0.0 | 1.0 | 1.0 ];
53 output float out1 = [ 1.0 | 0.0 | 0.0 ];
57 precision mediump float;
64 out0 = 1.0, out1 = 0.0;
70 case sequence_condition
73 input float in0 = [ 0.0 | 1.0 | 2.0 ];
74 output float out0 = [ 0.0 | 1.0 | 1.0 ];
75 output float out1 = [ 1.0 | 0.0 | 0.0 ];
79 precision mediump float;
85 if (false, in0 >= 1.0)
86 out0 = 1.0, out1 = 0.0;
92 case complex_condition
95 input float in0 = [ 0.0 | 1.0 | 2.0 ];
96 output float out0 = [ 0.0 | 1.0 | 1.0 ];
97 output float out1 = [ 1.0 | 0.0 | 0.0 ];
101 precision mediump float;
107 if (false || (in0 >= 1.0) && (in0 - 2.0*in0 < 0.0))
108 out0 = 1.0, out1 = 0.0;
117 input float in0 = [ 0.0 | 1.0 | 2.0 ];
118 output float out0 = [ 0.0 | 1.0 | 1.0 ];
122 precision mediump float;
138 input float in0 = [ 0.0 | 1.0 | 2.0 ];
139 output float out0 = [ 0.0 | 1.0 | 2.0 ];
143 precision mediump float;
160 input float in0 = [ 0.0 | 1.0 | 2.0 ];
161 output float out0 = [ 0.0 | 1.0 | 2.0 ];
165 precision mediump float;
180 case mixed_if_elseif_else
183 input float in0 = [ 0.0 | 1.0 | 2.0 ];
184 output float out0 = [ 0.0 | 1.0 | 2.0 ];
188 precision mediump float;
197 out0 = 2.0, out0 = 1.0;
205 case constant_conditional_assignment_to_matrix
207 // This variant doesn't provoke the crash seen in the versions below.
208 ${VERTEX_DECLARATIONS}
209 varying mediump float FragVarying;
210 const float in0 = 0.0;
213 mat2 projectionMatrix = mat2(0.0, 0.0, 0.0, 0.0);
216 projectionMatrix[0][0] = 1.0;
220 gl_Position = dEQP_Position + vec4(projectionMatrix[1][0], 0.0, 0.0, 0.0);
224 precision mediump float;
225 varying float FragVarying;
228 gl_FragColor = vec4(FragVarying, 1.0, 1.0, 1.0);
233 case input_conditional_assignment_to_matrix
236 input float in0 = [ 0.0 ];
239 ${VERTEX_DECLARATIONS}
240 varying mediump float FragVarying; // Necessary to reproduce.
243 // Crashes with mat4 as well. Does not crash with vectors.
244 mat2 projectionMatrix = mat2(0.0, 0.0, 0.0, 0.0);
245 // Testing a non-constant variable is necessary.
248 // Using the matrix variable appears necessary.
249 projectionMatrix[0][0] = 1.0;
253 // Referencing the matrix is necessary though clearly the compiler
254 // doesn't realize the assignment is useless.
255 gl_Position = dEQP_Position + vec4(projectionMatrix[1][0], 0.0, 0.0, 0.0);
259 precision mediump float;
260 varying float FragVarying;
263 gl_FragColor = vec4(FragVarying, 1.0, 1.0, 1.0);
268 case uniform_conditional_assignment_to_matrix
271 uniform float uni0 = [ 0.0 ];
274 ${VERTEX_DECLARATIONS}
275 varying mediump float FragVarying; // Necessary to reproduce.
278 // Crashes with mat4 as well. Does not crash with vectors.
279 mat2 projectionMatrix = mat2(0.0, 0.0, 0.0, 0.0);
280 // Testing a non-constant variable is necessary.
283 // Using the matrix variable appears necessary.
284 projectionMatrix[0][0] = 1.0;
288 // Referencing the matrix is necessary though clearly the compiler
289 // doesn't realize the assignment is useless.
290 gl_Position = dEQP_Position + vec4(projectionMatrix[1][0], 0.0, 0.0, 0.0);
294 precision mediump float;
295 varying float FragVarying;
298 gl_FragColor = vec4(FragVarying, 1.0, 1.0, 1.0);
305 group invalid_if "Invalid If Conditionals"
307 case missing_parenthesis
310 precision mediump float;
314 ${POSITION_FRAG_COLOR} = vec4(1.0);
319 case unclosed_parenthesis
322 precision mediump float;
326 ${POSITION_FRAG_COLOR} = vec4(1.0);
334 precision mediump float;
338 ${POSITION_FRAG_COLOR} = vec4(1.0);
343 case int_zero_condition
346 precision mediump float;
350 ${POSITION_FRAG_COLOR} = vec4(1.0);
355 case int_one_condition
358 precision mediump float;
362 ${POSITION_FRAG_COLOR} = vec4(1.0);
367 case int_uniform_condition
371 precision mediump float;
372 precision mediump int;
377 ${POSITION_FRAG_COLOR} = vec4(1.0);
385 precision mediump float;
389 ${POSITION_FRAG_COLOR} = vec4(1.0);
394 case float_zero_condition
397 precision mediump float;
401 ${POSITION_FRAG_COLOR} = vec4(1.0);
406 case float_one_condition
409 precision mediump float;
413 ${POSITION_FRAG_COLOR} = vec4(1.0);
418 case sampler_condition
421 precision mediump float;
422 uniform sampler2D s0;
426 ${POSITION_FRAG_COLOR} = vec4(1.0);