1 group if "If Statements"
7 input float in0 = [ 0.0 | 1.0 | 2.0 ];
8 output float out0 = [ 0.0 | 1.0 | 1.0 ];
13 precision mediump float;
25 case compound_statement
29 input float in0 = [ 0.0 | 1.0 | 2.0 ];
30 output float out0 = [ 0.0 | 1.0 | 1.0 ];
31 output float out1 = [ 1.0 | 0.0 | 0.0 ];
36 precision mediump float;
52 case sequence_statements
56 input float in0 = [ 0.0 | 1.0 | 2.0 ];
57 output float out0 = [ 0.0 | 1.0 | 1.0 ];
58 output float out1 = [ 1.0 | 0.0 | 0.0 ];
63 precision mediump float;
70 out0 = 1.0, out1 = 0.0;
76 case sequence_condition
80 input float in0 = [ 0.0 | 1.0 | 2.0 ];
81 output float out0 = [ 0.0 | 1.0 | 1.0 ];
82 output float out1 = [ 1.0 | 0.0 | 0.0 ];
87 precision mediump float;
93 if (false, in0 >= 1.0)
94 out0 = 1.0, out1 = 0.0;
100 case complex_condition
104 input float in0 = [ 0.0 | 1.0 | 2.0 ];
105 output float out0 = [ 0.0 | 1.0 | 1.0 ];
106 output float out1 = [ 1.0 | 0.0 | 0.0 ];
111 precision mediump float;
117 if (false || (in0 >= 1.0) && (in0 - 2.0*in0 < 0.0))
118 out0 = 1.0, out1 = 0.0;
128 input float in0 = [ 0.0 | 1.0 | 2.0 ];
129 output float out0 = [ 0.0 | 1.0 | 1.0 ];
134 precision mediump float;
151 input float in0 = [ 0.0 | 1.0 | 2.0 ];
152 output float out0 = [ 0.0 | 1.0 | 2.0 ];
157 precision mediump float;
175 input float in0 = [ 0.0 | 1.0 | 2.0 ];
176 output float out0 = [ 0.0 | 1.0 | 2.0 ];
181 precision mediump float;
196 case mixed_if_elseif_else
200 input float in0 = [ 0.0 | 1.0 | 2.0 ];
201 output float out0 = [ 0.0 | 1.0 | 2.0 ];
206 precision mediump float;
215 out0 = 2.0, out0 = 1.0;
223 case constant_conditional_assignment_to_matrix
227 // This variant doesn't provoke the crash seen in the versions below.
228 ${VERTEX_DECLARATIONS}
229 out mediump float FragVarying;
230 const float in0 = 0.0;
233 mat2 projectionMatrix = mat2(0.0, 0.0, 0.0, 0.0);
236 projectionMatrix[0][0] = 1.0;
240 gl_Position = dEQP_Position + vec4(projectionMatrix[1][0], 0.0, 0.0, 0.0);
245 precision mediump float;
246 ${FRAGMENT_DECLARATIONS}
247 in mediump float FragVarying;
250 ${FRAG_COLOR} = vec4(FragVarying, 1.0, 1.0, 1.0);
255 case input_conditional_assignment_to_matrix
259 input float in0 = [ 0.0 ];
263 ${VERTEX_DECLARATIONS}
264 out mediump float FragVarying; // Necessary to reproduce.
267 // Crashes with mat4 as well. Does not crash with vectors.
268 mat2 projectionMatrix = mat2(0.0, 0.0, 0.0, 0.0);
269 // Testing a non-constant variable is necessary.
272 // Using the matrix variable appears necessary.
273 projectionMatrix[0][0] = 1.0;
277 // Referencing the matrix is necessary though clearly the compiler
278 // doesn't realize the assignment is useless.
279 gl_Position = dEQP_Position + vec4(projectionMatrix[1][0], 0.0, 0.0, 0.0);
284 precision mediump float;
285 ${FRAGMENT_DECLARATIONS}
286 in mediump float FragVarying;
289 ${FRAG_COLOR} = vec4(FragVarying, 1.0, 1.0, 1.0);
294 case uniform_conditional_assignment_to_matrix
298 uniform float uni0 = [ 0.0 ];
302 precision mediump float;
303 ${VERTEX_DECLARATIONS}
304 out mediump float FragVarying; // Necessary to reproduce.
307 // Crashes with mat4 as well. Does not crash with vectors.
308 mat2 projectionMatrix = mat2(0.0, 0.0, 0.0, 0.0);
309 // Testing a non-constant variable is necessary.
312 // Using the matrix variable appears necessary.
313 projectionMatrix[0][0] = 1.0;
317 // Referencing the matrix is necessary though clearly the compiler
318 // doesn't realize the assignment is useless.
319 gl_Position = dEQP_Position + vec4(projectionMatrix[1][0], 0.0, 0.0, 0.0);
324 precision mediump float;
325 ${FRAGMENT_DECLARATIONS}
326 in mediump float FragVarying;
329 ${FRAG_COLOR} = vec4(FragVarying, 1.0, 1.0, 1.0);
336 group invalid_if "Invalid If Conditionals"
338 case missing_parenthesis
343 precision mediump float;
348 ${POSITION_FRAG_COLOR} = vec4(1.0);
353 case unclosed_parenthesis
358 precision mediump float;
363 ${POSITION_FRAG_COLOR} = vec4(1.0);
373 precision mediump float;
378 ${POSITION_FRAG_COLOR} = vec4(1.0);
383 case int_zero_condition
388 precision mediump float;
393 ${POSITION_FRAG_COLOR} = vec4(1.0);
398 case int_one_condition
403 precision mediump float;
408 ${POSITION_FRAG_COLOR} = vec4(1.0);
413 case int_uniform_condition
419 precision mediump float;
420 precision mediump int;
426 ${POSITION_FRAG_COLOR} = vec4(1.0);
436 precision mediump float;
441 ${POSITION_FRAG_COLOR} = vec4(1.0);
446 case float_zero_condition
451 precision mediump float;
456 ${POSITION_FRAG_COLOR} = vec4(1.0);
461 case float_one_condition
466 precision mediump float;
471 ${POSITION_FRAG_COLOR} = vec4(1.0);
476 case sampler_condition
481 precision mediump float;
482 uniform sampler2D s0;
487 ${POSITION_FRAG_COLOR} = vec4(1.0);