aboutsummaryrefslogtreecommitdiff
path: root/tests/spec/glsl-es-1.00/compiler/structure-and-array-operations/array-selection.vert
blob: dc3fe359aca6c8829d43c93b8c437a9e59bb1e96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* [config]
 * expect_result: pass
 * glsl_version: 1.20
 * glsles_version: 1.00
 * [end config]
 *
 * From page 38 (page 44 of the PDF) of the GLSL 1.20 spec:
 *
 *     "The ternary selection operator (?:). It operates on three expressions
 *     (exp1 ? exp2 : exp3)....The second and third expressions can be any
 *     type, as long their types match....This resulting matching type is
 *     the type of the entire expression."
 */


uniform vec4 a[2];
uniform vec4 b[2];
uniform int i;
uniform bool pick_from_a_or_b;

void main()
{
  gl_Position = (pick_from_a_or_b ? a : b)[i];
}