1 #X1. Type: float[5] // An array type with 5 elements
2 #X2. Return value: float[5] func() { ... } // Function with a 5-element array return value
3 #X3. Array constructor: float[3] (1.0, 2.0, 5.5) // 3-element array with given elements
4 # // Fails with array of matrices!
5 #X4. As unnamed parameter: void func(float[5]);
6 #X5. Variable declaration: float[5] a; // Equivalent to float a[5]; (?)
7 #X6. Empty brackets: float x[] = float[] (1.0, 2.0, 3.0); // Size of x is 3
8 # float y[] = float[3] (1.0, 2.0, 3.0); // Size of y is 3 (equivalent)
9 # float z[] = y; // Size of z is 3
10 #X7. Testing that 2-dimensional arrays don't work: float a[5][3]; // Illegal
11 # float[5] a[3]; // Illegal
12 #X8. Testing that array declaration with dynamic variables as array size won't work.
13 #X9. Testing length() operator: z.length(); // Returns 3 for z defined before
14 #X10. Test C/C++ style {}-constructor
15 #X11. Test struct arrays
16 #X12. Test array element access at initialization with const/dynamic values
18 group constructor "Array constructors"
24 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
25 output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
30 precision mediump float;
37 x = float[3] (in0.z, in0.x, in0.y);
38 out0 = vec3(x[0], x[1], x[2]);
48 input vec4 in0 = [ vec4(0.5, 1.0, 2.0, 0.2) | vec4(7.4, -1.0, 2.0, -1.3) | vec4(3.0, 1.6, -2.0, 0.5) ];
49 output vec4 out0 = [ vec4(2.0, 0.5, 0.2, 1.0) | vec4(2.0, 7.4, -1.3, -1.0) | vec4(-2.0, 3.0, 0.5, 1.6) ];
54 precision mediump float;
61 x = float[4] (in0.z, in0.x, in0.w, in0.y);
62 out0 = vec4(x[0], x[1], x[2], x[3]);
72 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
73 output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
78 precision mediump int;
79 precision mediump float;
86 x = int[3] (in0.z, in0.x, in0.y);
87 out0 = ivec3(x[0], x[1], x[2]);
97 input ivec4 in0 = [ ivec4(0, 1, 2, 0) | ivec4(7, -1, 2, -1) | ivec4(3, 1, -2, 0) ];
98 output ivec4 out0 = [ ivec4(2, 0, 0, 1) | ivec4(2, 7, -1, -1) | ivec4(-2, 3, 0, 1) ];
103 precision mediump int;
104 precision mediump float;
111 x = int[4] (in0.z, in0.x, in0.w, in0.y);
112 out0 = ivec4(x[0], x[1], x[2], x[3]);
122 input bvec3 in0 = [ bvec3(true, true, false) ];
123 output bvec3 out0 = [ bvec3(false, true, true) ];
128 precision mediump float;
135 x = bool[3] (in0.z, in0.x, in0.y);
136 out0 = bvec3(x[0], x[1], x[2]);
146 input bvec4 in0 = [ bvec4(true, true, false, false) ];
147 output bvec4 out0 = [ bvec4(false, true, true, false) ];
152 precision mediump float;
159 x = bool[4] (in0.z, in0.x, in0.y, in0.w);
160 out0 = bvec4(x[0], x[1], x[2], x[3]);
170 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
171 output vec3 out0 = [ vec3(2.0, -0.5, -1.0) ];
176 precision mediump float;
191 test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
192 test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
193 test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
195 test[3] x = test[3] (a, b, c);
197 out0 = vec3(x[0].f, x[1].v.y, x[2].v.x);
207 input vec4 in0 = [ vec4(0.5, 1.0, 2.0, 1.5) ];
208 output vec4 out0 = [ vec4(2.0, -0.5, -1.0, -1.5) ];
213 precision mediump float;
228 test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
229 test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
230 test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
231 test d = test(-in0.w, vec3(-in0.w, -in0.x, -in0.z));
233 test[4] x = test[4] (a, b, c, d);
235 out0 = vec4(x[0].f, x[1].v.y, x[2].v.x, x[3].v.x);
246 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
247 output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(7.4, -2.0, -1.0) | vec3(3.0, 2.0, 1.6) ];
252 precision mediump float;
260 x = vec3[3] ( vec3(in0.x, in0.y, in0.z) ,
261 vec3(-in0.y, -in0.z, -in0.x),
262 vec3(in0.z, in0.x, in0.y) );
263 out0 = vec3(x[0].x, x[1].y, x[2].z);
273 input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
274 output ivec3 out0 = [ ivec3(5, -2, 1) | ivec3(7, -2, -1) | ivec3(3, 2, 1) ];
279 precision mediump int;
280 precision mediump float;
288 x = ivec3[3] ( ivec3(in0.x, in0.y, in0.z) ,
289 ivec3(-in0.y, -in0.z, -in0.x),
290 ivec3(in0.z, in0.x, in0.y) );
291 out0 = ivec3(x[0].x, x[1].y, x[2].z);
301 input bvec3 in0 = [ bvec3(true, false, true) ];
302 output bvec3 out0 = [ bvec3(true, true, false) ];
307 precision mediump float;
315 x = bvec3[3] ( bvec3(in0.x, in0.y, in0.z) ,
316 bvec3(in0.y, in0.z, in0.x),
317 bvec3(in0.z, in0.x, in0.y) );
318 out0 = bvec3(x[0].x, x[1].y, x[2].z);
328 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
329 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
334 precision mediump float;
340 mat3[3] a = mat3[3] ( mat3( in0.x, in0.y, in0.z,
342 in0.x, in0.y, in0.z) ,
343 mat3( in0.z, in0.x, -in0.y,
344 in0.z, in0.x, -in0.y,
345 in0.z, in0.x, -in0.y) ,
346 mat3( -in0.z, -in0.z, in0.z,
347 -in0.y, -in0.y, in0.y,
348 -in0.x, -in0.x, in0.x) );
354 float ret0 = a0[2][0];
355 float ret1 = a1[0][2];
356 float ret2 = a2[1][2];
358 out0 = vec3(ret0, ret1, ret2);
368 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
369 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
374 precision mediump int;
375 precision mediump float;
381 mat3[3] a = mat3[3] ( mat3( in0.x, in0.y, in0.z,
383 in0.x, in0.y, in0.z) ,
384 mat3( in0.z, in0.x, -in0.y,
385 in0.z, in0.x, -in0.y,
386 in0.z, in0.x, -in0.y) ,
387 mat3( -in0.z, -in0.z, in0.z,
388 -in0.y, -in0.y, in0.y,
389 -in0.x, -in0.x, in0.x) );
395 float ret0 = a0[2][0];
396 float ret1 = a1[0][2];
397 float ret2 = a2[1][2];
399 out0 = ivec3(ret0, ret1, ret2);
409 input bvec3 in0 = [ bvec3(true, false, true) ];
410 output bvec3 out0 = [ bvec3(true, false, false) ];
415 precision mediump float;
421 mat3[3] a = mat3[3] ( mat3( in0.x, in0.y, in0.z,
423 in0.x, in0.y, in0.z) ,
424 mat3( in0.z, in0.x, in0.y,
426 in0.z, in0.x, in0.y) ,
427 mat3( in0.z, in0.z, in0.z,
429 in0.x, in0.x, in0.x) );
435 float ret0 = a0[2][0];
436 float ret1 = a1[0][2];
437 float ret2 = a2[1][2];
439 out0 = bvec3(ret0, ret1, ret2);
447 group return "Arrays as return value"
453 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
454 output vec3 out0 = [ vec3(2.0, -0.5, 1.0) | vec3(2.0, -7.4, -1.0) | vec3(-2.0, -3.0, 1.6) ];
459 precision mediump float;
462 float[3] func(vec3 a)
464 return float[3] (a.z, -a.x, a.y);
470 float[3] x = func(in0);
471 out0 = vec3(x[0], x[1], x[2]);
481 input ivec3 in0 = [ ivec3(4, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
482 output ivec3 out0 = [ ivec3(2, -4, 1) | ivec3(2, -7, -1) | ivec3(-2, -3, 1) ];
487 precision mediump int;
488 precision mediump float;
493 return int[3] (a.z, -a.x, a.y);
499 int[3] x = func(in0);
500 out0 = ivec3(x[0], x[1], x[2]);
510 input bvec3 in0 = [ bvec3(false, true, true) ];
511 output bvec3 out0 = [ bvec3(true, false, true) ];
516 precision mediump float;
519 bool[3] func(bvec3 a)
521 return bool[3] (a.z, a.x, a.y);
527 bool[3] x = func(in0);
528 out0 = bvec3(x[0], x[1], x[2]);
540 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
541 output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ];
546 precision mediump float;
549 vec3[3] func(vec3[3] a)
551 return vec3[3] (a[1], a[2], a[0]);
557 vec3[3] x = vec3[3](vec3(in0.x, in0.y, -in0.z) ,
558 vec3(in0.y, -in0.z, in0.x) ,
559 vec3(-in0.z, in0.x, in0.y) );
561 out0 = vec3(x[0].x, x[1].y, x[2].z);
571 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
572 output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ];
577 precision mediump float;
586 test[3] func(test[3] a)
588 return test[3] (a[1], a[2], a[0]);
595 test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
596 test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
597 test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
599 test[3] t = test[3] (a, b, c);
602 out0 = vec3(x[0].v.z, x[1].v.y, x[2].v.x);
612 input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ];
613 output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ];
618 precision mediump int;
619 precision mediump float;
622 ivec3[3] func(ivec3[3] a)
624 return ivec3[3] (a[1], a[2], a[0]);
630 ivec3[3] x = ivec3[3]( ivec3(in0.x, in0.y, -in0.z) ,
631 ivec3(in0.y, -in0.z, in0.x) ,
632 ivec3(-in0.z, in0.x, in0.y) );
634 out0 = ivec3(x[0].x, x[1].y, x[2].z);
644 input bvec3 in0 = [ bvec3(true, false, false) ];
645 output bvec3 out0 = [ bvec3(false, true, false) ];
650 precision mediump int;
651 precision mediump float;
654 bvec3[3] func(bvec3[3] a)
656 return bvec3[3] (a[1], a[2], a[0]);
662 bvec3[3] x = bvec3[3]( bvec3(in0.x, in0.y, in0.z) ,
663 bvec3(in0.y, in0.z, in0.x) ,
664 bvec3(in0.z, in0.x, in0.y) );
666 out0 = bvec3(x[0].x, x[1].y, x[2].z);
676 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
677 output vec3 out0 = [ vec3(2.0, -1.0, 2.0) | vec3(-2.3, 0.0, -2.3) ];
682 precision mediump float;
685 mat3[3] func(mat3[3] x)
698 a[0] = mat3(in0.x, in0.y, in0.z,
700 in0.x, in0.y, in0.z);
701 a[1] = mat3(in0.z, in0.x, -in0.y,
702 in0.z, in0.x, -in0.y,
703 in0.z, in0.x, -in0.y);
704 a[2] = mat3(-in0.z, -in0.z, in0.z,
705 -in0.y, -in0.y, in0.y,
706 -in0.x, -in0.x, in0.x);
714 float ret0 = b0[0][0];
715 float ret1 = b1[1][1];
716 float ret2 = b2[2][2];
718 out0 = vec3(ret0, ret1, ret2);
728 input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-1, 0, -2) ];
729 output ivec3 out0 = [ ivec3(2, -1, 2) | ivec3(-2, 0, -2) ];
734 precision mediump int;
735 precision mediump float;
738 mat3[3] func(mat3[3] x)
751 a[0] = mat3(in0.x, in0.y, in0.z,
753 in0.x, in0.y, in0.z);
754 a[1] = mat3(in0.z, in0.x, -in0.y,
755 in0.z, in0.x, -in0.y,
756 in0.z, in0.x, -in0.y);
757 a[2] = mat3(-in0.z, -in0.z, in0.z,
758 -in0.y, -in0.y, in0.y,
759 -in0.x, -in0.x, in0.x);
767 float ret0 = b0[0][0];
768 float ret1 = b1[1][1];
769 float ret2 = b2[2][2];
771 out0 = ivec3(ret0, ret1, ret2);
781 input bvec3 in0 = [ bvec3(true, false, true) | bvec3(true, true, false) ];
782 output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, false) ];
787 precision mediump float;
790 mat3[3] func(mat3[3] x)
803 a[0] = mat3(in0.x, in0.y, in0.z,
805 in0.x, in0.y, in0.z);
806 a[1] = mat3(in0.z, in0.x, in0.y,
808 in0.z, in0.x, in0.y);
809 a[2] = mat3(in0.z, in0.z, in0.z,
811 in0.x, in0.x, in0.x);
819 float ret0 = b0[0][0];
820 float ret1 = b1[1][1];
821 float ret2 = b2[2][2];
823 out0 = bvec3(ret0, ret1, ret2);
831 group unnamed_parameter "Array type as unnamed parameter of a function prototype"
837 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
838 output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
843 precision mediump float;
846 float[3] func(float[3]);
851 float[3] a = float[3] (in0.x, in0.y, in0.z);
852 float[3] b = func(a);
853 out0 = vec3(b[0], b[1], b[2]);
857 float[3] func(float[3] a)
859 return float[3] (a[2], a[0], a[1]);
869 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
870 output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
875 precision mediump int;
876 precision mediump float;
884 int[3] a = int[3] (in0.x, in0.y, in0.z);
886 out0 = ivec3(b[0], b[1], b[2]);
890 int[3] func(int[3] a)
892 return int[3] (a[2], a[0], a[1]);
902 input bvec3 in0 = [ bvec3(false, true, true) ];
903 output bvec3 out0 = [ bvec3(true, false, true) ];
908 precision mediump float;
911 bool[3] func(bool[3]);
916 bool[3] a = bool[3] (in0.x, in0.y, in0.z);
918 out0 = bvec3(b[0], b[1], b[2]);
922 bool[3] func(bool[3] a)
924 return bool[3] (a[2], a[0], a[1]);
934 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
935 output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ];
940 precision mediump float;
949 test[3] func(test[3]);
955 test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
956 test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
957 test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
959 test[3] t = test[3] (a, b, c);
961 out0 = vec3(x[0].v.z, x[1].v.y, x[2].v.x);
965 test[3] func(test[3] a)
967 return test[3] (a[1], a[2], a[0]);
977 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
978 output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ];
983 precision mediump float;
986 vec3[3] func(vec3[3]);
991 vec3[3] x = vec3[3](vec3(in0.x, in0.y, -in0.z) ,
992 vec3(in0.y, -in0.z, in0.x) ,
993 vec3(-in0.z, in0.x, in0.y) );
995 out0 = vec3(x[0].x, x[1].y, x[2].z);
999 vec3[3] func(vec3[3] a)
1001 return vec3[3] (a[1], a[2], a[0]);
1010 input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ];
1011 output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ];
1016 precision mediump int;
1017 precision mediump float;
1020 ivec3[3] func(ivec3[3]);
1025 ivec3[3] x = ivec3[3]( ivec3(in0.x, in0.y, -in0.z) ,
1026 ivec3(in0.y, -in0.z, in0.x) ,
1027 ivec3(-in0.z, in0.x, in0.y) );
1029 out0 = ivec3(x[0].x, x[1].y, x[2].z);
1033 ivec3[3] func(ivec3[3] a)
1035 return ivec3[3] (a[1], a[2], a[0]);
1044 input bvec3 in0 = [ bvec3(true, false, false) ];
1045 output bvec3 out0 = [ bvec3(false, true, false) ];
1050 precision mediump int;
1051 precision mediump float;
1054 bvec3[3] func(bvec3[3]);
1059 bvec3[3] x = bvec3[3]( bvec3(in0.x, in0.y, in0.z) ,
1060 bvec3(in0.y, in0.z, in0.x) ,
1061 bvec3(in0.z, in0.x, in0.y) );
1063 out0 = bvec3(x[0].x, x[1].y, x[2].z);
1067 bvec3[3] func(bvec3[3] a)
1069 return bvec3[3] (a[1], a[2], a[0]);
1079 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
1080 output vec3 out0 = [ vec3(2.0, -1.0, 2.0) | vec3(-2.3, 0.0, -2.3) ];
1085 precision mediump float;
1088 mat3[3] func(mat3[3]);
1094 a[0] = mat3(in0.x, in0.y, in0.z,
1095 in0.x, in0.y, in0.z,
1096 in0.x, in0.y, in0.z);
1097 a[1] = mat3(in0.z, in0.x, -in0.y,
1098 in0.z, in0.x, -in0.y,
1099 in0.z, in0.x, -in0.y);
1100 a[2] = mat3(-in0.z, -in0.z, in0.z,
1101 -in0.y, -in0.y, in0.y,
1102 -in0.x, -in0.x, in0.x);
1110 float ret0 = b0[0][0];
1111 float ret1 = b1[1][1];
1112 float ret2 = b2[2][2];
1114 out0 = vec3(ret0, ret1, ret2);
1118 mat3[3] func(mat3[3] x)
1133 input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-1, 0, -2) ];
1134 output ivec3 out0 = [ ivec3(2, -1, 2) | ivec3(-2, 0, -2) ];
1139 precision mediump int;
1140 precision mediump float;
1143 mat3[3] func(mat3[3]);
1149 a[0] = mat3(in0.x, in0.y, in0.z,
1150 in0.x, in0.y, in0.z,
1151 in0.x, in0.y, in0.z);
1152 a[1] = mat3(in0.z, in0.x, -in0.y,
1153 in0.z, in0.x, -in0.y,
1154 in0.z, in0.x, -in0.y);
1155 a[2] = mat3(-in0.z, -in0.z, in0.z,
1156 -in0.y, -in0.y, in0.y,
1157 -in0.x, -in0.x, in0.x);
1165 float ret0 = b0[0][0];
1166 float ret1 = b1[1][1];
1167 float ret2 = b2[2][2];
1169 out0 = ivec3(ret0, ret1, ret2);
1173 mat3[3] func(mat3[3] x)
1188 input bvec3 in0 = [ bvec3(true, false, true) | bvec3(true, true, false) ];
1189 output bvec3 out0 = [ bvec3(true, false, true) | bvec3(false, true, false) ];
1194 precision mediump float;
1197 mat3[3] func(mat3[3]);
1202 a[0] = mat3(in0.x, in0.y, in0.z,
1203 in0.x, in0.y, in0.z,
1204 in0.x, in0.y, in0.z);
1205 a[1] = mat3(in0.z, in0.x, in0.y,
1206 in0.z, in0.x, in0.y,
1207 in0.z, in0.x, in0.y);
1208 a[2] = mat3(in0.z, in0.z, in0.z,
1209 in0.y, in0.y, in0.y,
1210 in0.x, in0.x, in0.x);
1218 float ret0 = b0[0][0];
1219 float ret1 = b1[1][1];
1220 float ret2 = b2[2][2];
1222 out0 = bvec3(ret0, ret1, ret2);
1226 mat3[3] func(mat3[3] x)
1237 end # unnamed_parameter
1239 group declaration "Declaring arrays"
1241 case implicit_size_float
1245 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
1246 output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
1251 precision mediump float;
1257 float[] x = float[] (in0.z, in0.x, in0.y);
1260 out0 = vec3(y[0], y[1], y[2]);
1266 case implicit_size_int
1270 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
1271 output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
1276 precision mediump int;
1277 precision mediump float;
1283 int[] x = int[] (in0.z, in0.x, in0.y);
1286 out0 = ivec3(y[0], y[1], y[2]);
1292 case implicit_size_bool
1296 input bvec3 in0 = [ bvec3(false, true, true) ];
1297 output bvec3 out0 = [ bvec3(true, false, true) ];
1302 precision mediump float;
1308 bool[] x = bool[] (in0.z, in0.x, in0.y);
1311 out0 = bvec3(y[0], y[1], y[2]);
1317 case implicit_size_struct
1321 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1322 output vec3 out0 = [ vec3(-1.0, -0.5, 2.0) ];
1327 precision mediump float;
1340 test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
1341 test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
1342 test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
1344 test[] x = test[] (c, b, a);
1347 out0 = vec3(y[0].v.x, y[1].v.y, y[2].v.z);
1353 case implicit_size_float_vec3
1357 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
1358 output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(-0.5, 1.0, 11.2) ];
1363 precision mediump float;
1369 vec3[] x = vec3[] ( vec3(in0.x, in0.y, -in0.z) ,
1370 vec3(in0.y, -in0.z, in0.x) ,
1371 vec3(-in0.z, in0.x, in0.y) );
1373 out0 = vec3(y[0].x, y[1].y, y[2].z);
1379 case implicit_size_int_ivec3
1383 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(5, 11, -1) ];
1384 output ivec3 out0 = [ ivec3(0, -2, 1) | ivec3(5, 1, 11) ];
1389 precision mediump int;
1390 precision mediump float;
1396 ivec3[] x = ivec3[] ( ivec3(in0.x, in0.y, -in0.z) ,
1397 ivec3(in0.y, -in0.z, in0.x) ,
1398 ivec3(-in0.z, in0.x, in0.y) );
1400 out0 = ivec3(y[0].x, y[1].y, y[2].z);
1406 case implicit_size_bool_bvec3
1410 input bvec3 in0 = [ bvec3(true, false, true) ];
1411 output bvec3 out0 = [ bvec3(true, true, false) ];
1416 precision mediump float;
1422 bvec3[] x = bvec3[] ( bvec3(in0.x, in0.y, in0.z) ,
1423 bvec3(in0.y, in0.z, in0.x) ,
1424 bvec3(in0.z, in0.x, in0.y) );
1426 out0 = bvec3(y[0].x, y[1].y, y[2].z);
1432 case implicit_size_float_mat3
1436 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
1437 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
1442 precision mediump float;
1448 mat3[] a = mat3[] ( mat3( in0.x, in0.y, in0.z,
1449 in0.x, in0.y, in0.z,
1450 in0.x, in0.y, in0.z) ,
1451 mat3( in0.z, in0.x, -in0.y,
1452 in0.z, in0.x, -in0.y,
1453 in0.z, in0.x, -in0.y) ,
1454 mat3( -in0.z, -in0.z, in0.z,
1455 -in0.y, -in0.y, in0.y,
1456 -in0.x, -in0.x, in0.x) );
1462 float ret0 = a0[2][0];
1463 float ret1 = a1[0][2];
1464 float ret2 = a2[1][2];
1466 out0 = vec3(ret0, ret1, ret2);
1472 case implicit_size_int_mat3
1476 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
1477 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
1482 precision mediump int;
1483 precision mediump float;
1489 mat3[] a = mat3[] ( mat3( in0.x, in0.y, in0.z,
1490 in0.x, in0.y, in0.z,
1491 in0.x, in0.y, in0.z) ,
1492 mat3( in0.z, in0.x, -in0.y,
1493 in0.z, in0.x, -in0.y,
1494 in0.z, in0.x, -in0.y) ,
1495 mat3( -in0.z, -in0.z, in0.z,
1496 -in0.y, -in0.y, in0.y,
1497 -in0.x, -in0.x, in0.x) );
1503 float ret0 = a0[2][0];
1504 float ret1 = a1[0][2];
1505 float ret2 = a2[1][2];
1507 out0 = ivec3(ret0, ret1, ret2);
1513 case implicit_size_bool_mat3
1517 input bvec3 in0 = [ bvec3(true, false, true) ];
1518 output bvec3 out0 = [ bvec3(true, false, false) ];
1523 precision mediump float;
1529 mat3[] a = mat3[] ( mat3( in0.x, in0.y, in0.z,
1530 in0.x, in0.y, in0.z,
1531 in0.x, in0.y, in0.z) ,
1532 mat3( in0.z, in0.x, in0.y,
1533 in0.z, in0.x, in0.y,
1534 in0.z, in0.x, in0.y) ,
1535 mat3( in0.z, in0.z, in0.z,
1536 in0.y, in0.y, in0.y,
1537 in0.x, in0.x, in0.x) );
1543 float ret0 = a0[2][0];
1544 float ret1 = a1[0][2];
1545 float ret2 = a2[1][2];
1547 out0 = bvec3(ret0, ret1, ret2);
1554 case constant_expression_array_size
1559 precision mediump float;
1569 float[array1.length()] array3;
1576 case constant_expression_array_access
1580 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1581 output vec3 out0 = [ vec3(-2.0, -1.0, -0.5) ];
1586 precision mediump float;
1595 float x = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [a];
1596 float y = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [b+2];
1597 float z = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [5];
1598 out0 = vec3(x, y, z);
1604 case dynamic_expression_array_access
1608 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1609 input ivec2 in1 = ivec2(3, 2);
1610 output vec3 out0 = [ vec3(-2.0, -1.0, -0.5) ];
1615 precision mediump float;
1621 float x = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.x];
1622 float y = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.y+2];
1623 float z = float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) [in1.x+in1.y];
1624 out0 = vec3(x, y, z);
1630 case multiple_declarations_single_statement_explicit
1634 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1635 output vec3 out0 = [ vec3(2.0, -1.0, 0.5) ];
1640 precision mediump float;
1646 float[] x = float[6] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
1647 y = float[2] (in0.x, -in0.y);
1648 out0 = vec3(x[2], y[1], x[0]);
1654 case multiple_declarations_single_statement_implicit
1658 input ivec3 in0 = [ ivec3(5, 1, 2) ];
1659 output ivec3 out0 = [ ivec3(2, -1, 5) ];
1664 precision mediump float;
1670 int[] x = int[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
1671 y = int[] (in0.x, -in0.y);
1672 out0 = ivec3(x[2], y[1], x[0]);
1680 group length "Array length method"
1686 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1687 output ivec3 out0 = [ ivec3(3, 5, 13) ];
1692 precision mediump float;
1698 float[] x = float[3] (in0.z, in0.x, in0.y);
1699 float[] y = float[] (in0.z, in0.x, in0.y, in0.x, in0.y);
1702 out0 = ivec3(x.length(), y.length(), z.length());
1712 input ivec3 in0 = [ ivec3(0, 1, 2) ];
1713 output ivec3 out0 = [ ivec3(3, 5, 13) ];
1718 precision mediump int;
1719 precision mediump float;
1725 int[] x = int[3] (in0.z, in0.x, in0.y);
1726 int[] y = int[] (in0.z, in0.x, in0.y, in0.x, in0.y);
1729 out0 = ivec3(x.length(), y.length(), z.length());
1739 input bvec3 in0 = [ bvec3(true, false, true) ];
1740 output ivec3 out0 = [ ivec3(3, 5, 13) ];
1745 precision mediump float;
1751 bool[] x = bool[3] (in0.z, in0.x, in0.y);
1752 bool[] y = bool[] (in0.z, in0.x, in0.y, in0.x, in0.y);
1755 out0 = ivec3(x.length(), y.length(), z.length());
1765 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1766 output ivec3 out0 = [ ivec3(3, 5, 13) ];
1771 precision mediump float;
1784 test a = test(in0.z, vec3(in0.x, in0.y, in0.z));
1785 test b = test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
1786 test c = test(in0.x, vec3(-in0.y, in0.z, -in0.x));
1788 test[] x = test[3] (a, b, c);
1789 test[] y = test[] (c, a, b, b, a);
1792 out0 = ivec3(x.length(), y.length(), z.length());
1800 group invalid "Invalid Functions"
1802 case multidimensional_array1
1808 precision mediump float;
1814 ${POSITION_FRAG_COLOR} = vec4(1.0);
1819 case multidimensional_array2
1825 precision mediump float;
1831 ${POSITION_FRAG_COLOR} = vec4(1.0);
1836 case multidimensional_uniform_array
1842 precision mediump float;
1844 uniform float a[3][2];
1848 ${POSITION_FRAG_COLOR} = vec4(1.0);
1853 case multidimensional_array_in_uniform_block
1859 precision mediump float;
1868 ${POSITION_FRAG_COLOR} = vec4(1.0);
1873 case dynamic_expression_array_size
1879 precision mediump float;
1886 ${POSITION_FRAG_COLOR} = vec4(1.0);
1891 case empty_declaration_without_var_name
1893 expect compile_or_link_fail
1897 precision mediump float;
1903 ${POSITION_FRAG_COLOR} = vec4(1.0);
1908 case empty_declaration_with_var_name
1910 expect compile_or_link_fail
1914 precision mediump float;
1920 ${POSITION_FRAG_COLOR} = vec4(1.0);
1925 case constructor_c_style1
1931 precision mediump float;
1937 a = float[3] { 1.0, 2.0, 3.0 };
1939 ${POSITION_FRAG_COLOR} = vec4(1.0);
1944 case constructor_c_style2
1950 precision mediump float;
1955 float a[5] = { 1.0, 2.0, 3.0 };
1957 ${POSITION_FRAG_COLOR} = vec4(1.0);
1962 case constructor_c_style3
1968 precision mediump float;
1973 float a[] = float[3] { 1.0, 2.0, 3.0 };
1975 ${POSITION_FRAG_COLOR} = vec4(1.0);
1980 case constructor_c_style4
1986 precision mediump float;
1991 float a[3] = { 1.0, 2.0, 3.0 };
1993 ${POSITION_FRAG_COLOR} = vec4(1.0);
2000 # https://github.com/KhronosGroup/WebGL/blob/master/sdk/tests/conformance2/glsl3/array-in-complex-expression.html
2001 group complex_expression "Arrays in complex expressions"
2003 case and_short_circuits
2012 precision mediump float;
2017 return int[2](g, g);
2028 int a[2] = int[2](0, 0);
2029 // The plus() call must not be evaluated, since && short-circuits
2030 minus() && (a == plus());
2036 case or_short_circuits
2045 precision mediump float;
2050 return int[2](g, g);
2061 int a[2] = int[2](0, 0);
2062 // The function call must not be evaluated, since && short-circuits
2063 minus() && (a == plus());
2069 case ternary_only_evaluates_one_operand
2078 precision mediump float;
2083 return int[2](g, g);
2089 int a[2] = int[2](0, 0);
2090 // The function call must not be evaluated, since the condition is true.
2091 (g == 0) ? true : (a == plus());
2097 case sequence_side_effects_affecting_compared_array_content
2101 output bool success = true;
2106 precision mediump float;
2109 int[2] func(int param) {
2110 return int[2](param, param);
2116 for (int i = 0; i < 2; ++i) {
2120 // Sequence operator evaluates operands from left to right (ESSL 3.00 section 5.9).
2121 // The function call that returns the array needs to be evaluated after ++j
2122 // for the expression to return the correct value (true).
2123 success = ((++j), (a == func(j)));
2129 end # complex_expression
2131 group compare "Array comparisons"
2133 case equal_lowp_int_lowp_int
2137 output bool success = true;
2142 precision lowp float;
2147 lowp int x[3] = int[3](1, 2, 3);
2156 case equal_lowp_uint_lowp_uint
2160 output bool success = true;
2165 precision lowp float;
2170 lowp uint x[3] = uint[3](1u, 2u, 3u);
2179 case equal_lowp_float_lowp_float
2183 output bool success = true;
2188 precision lowp float;
2193 lowp float x[3] = float[3](1.0, 2.0, 3.0);
2194 lowp float y[3] = x;
2202 case equal_lowp_vec2_lowp_vec2
2206 output bool success = true;
2211 precision lowp float;
2216 lowp vec2 x[3] = vec2[3](vec2(1.0, 2.0),
2227 case equal_lowp_vec3_lowp_vec3
2231 output bool success = true;
2236 precision lowp float;
2241 lowp vec3 x[3] = vec3[3](vec3(1.0, 2.0, 3.0),
2242 vec3(4.0, 5.0, 6.0),
2243 vec3(7.0, 8.0, 9.0));
2252 case equal_lowp_vec4_lowp_vec4
2256 output bool success = true;
2261 precision lowp float;
2266 lowp vec4 x[3] = vec4[3](vec4(1.0, 2.0, 3.0, 4.0),
2267 vec4(5.0, 6.0, 7.0, 8.0),
2268 vec4(9.0, 10.0, 11.0, 12.0));
2277 case equal_lowp_ivec2_lowp_ivec2
2281 output bool success = true;
2286 precision lowp float;
2291 lowp ivec2 x[3] = ivec2[3](ivec2(1, 2),
2294 lowp ivec2 y[3] = x;
2302 case equal_lowp_ivec3_lowp_ivec3
2306 output bool success = true;
2311 precision lowp float;
2316 lowp ivec3 x[3] = ivec3[3](ivec3(1, 2, 3),
2319 lowp ivec3 y[3] = x;
2327 case equal_lowp_ivec4_lowp_ivec4
2331 output bool success = true;
2336 precision lowp float;
2341 lowp ivec4 x[3] = ivec4[3](ivec4(1, 2, 3, 4),
2343 ivec4(9, 10, 11, 12));
2344 lowp ivec4 y[3] = x;
2352 case equal_lowp_uvec2_lowp_uvec2
2356 output bool success = true;
2361 precision lowp float;
2366 lowp uvec2 x[3] = uvec2[3](uvec2(1u, 2u),
2369 lowp uvec2 y[3] = x;
2377 case equal_lowp_uvec3_lowp_uvec3
2381 output bool success = true;
2386 precision lowp float;
2391 lowp uvec3 x[3] = uvec3[3](uvec3(1u, 2u, 3u),
2394 lowp uvec3 y[3] = x;
2402 case equal_lowp_uvec4_lowp_uvec4
2406 output bool success = true;
2411 precision lowp float;
2416 lowp uvec4 x[3] = uvec4[3](uvec4(1u, 2u, 3u, 4u),
2417 uvec4(5u, 6u, 7u, 8u),
2418 uvec4(9u, 10u, 11u, 12u));
2419 lowp uvec4 y[3] = x;
2427 case equal_lowp_mat2_lowp_mat2
2431 output bool success = true;
2436 precision lowp float;
2441 lowp mat2 x[3] = mat2[3](mat2(1.0, 2.0, 3.0, 4.0),
2442 mat2(5.0, 6.0, 7.0, 8.0),
2443 mat2(9.0, 10.0, 11.0, 12.0));
2452 case equal_lowp_mat3_lowp_mat3
2456 output bool success = true;
2461 precision lowp float;
2466 lowp mat3 x[3] = mat3[3](mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0),
2467 mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0),
2468 mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0));
2477 case equal_lowp_mat4_lowp_mat4
2481 output bool success = true;
2486 precision lowp float;
2491 lowp mat4 x[3] = mat4[3](mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0),
2492 mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0),
2493 mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0));
2502 case equal_mediump_int_lowp_int
2506 output bool success = true;
2511 precision mediump float;
2516 mediump int x[3] = int[3](1, 2, 3);
2525 case equal_mediump_uint_lowp_uint
2529 output bool success = true;
2534 precision mediump float;
2539 mediump uint x[3] = uint[3](1u, 2u, 3u);
2548 case equal_mediump_float_lowp_float
2552 output bool success = true;
2557 precision mediump float;
2562 mediump float x[3] = float[3](1.0, 2.0, 3.0);
2563 lowp float y[3] = x;
2571 case equal_mediump_vec2_lowp_vec2
2575 output bool success = true;
2580 precision mediump float;
2585 mediump vec2 x[3] = vec2[3](vec2(1.0, 2.0),
2596 case equal_mediump_vec3_lowp_vec3
2600 output bool success = true;
2605 precision mediump float;
2610 mediump vec3 x[3] = vec3[3](vec3(1.0, 2.0, 3.0),
2611 vec3(4.0, 5.0, 6.0),
2612 vec3(7.0, 8.0, 9.0));
2621 case equal_mediump_vec4_lowp_vec4
2625 output bool success = true;
2630 precision mediump float;
2635 mediump vec4 x[3] = vec4[3](vec4(1.0, 2.0, 3.0, 4.0),
2636 vec4(5.0, 6.0, 7.0, 8.0),
2637 vec4(9.0, 10.0, 11.0, 12.0));
2646 case equal_mediump_ivec2_lowp_ivec2
2650 output bool success = true;
2655 precision mediump float;
2660 mediump ivec2 x[3] = ivec2[3](ivec2(1, 2),
2663 lowp ivec2 y[3] = x;
2671 case equal_mediump_ivec3_lowp_ivec3
2675 output bool success = true;
2680 precision mediump float;
2685 mediump ivec3 x[3] = ivec3[3](ivec3(1, 2, 3),
2688 lowp ivec3 y[3] = x;
2696 case equal_mediump_ivec4_lowp_ivec4
2700 output bool success = true;
2705 precision mediump float;
2710 mediump ivec4 x[3] = ivec4[3](ivec4(1, 2, 3, 4),
2712 ivec4(9, 10, 11, 12));
2713 lowp ivec4 y[3] = x;
2721 case equal_mediump_uvec2_lowp_uvec2
2725 output bool success = true;
2730 precision mediump float;
2735 mediump uvec2 x[3] = uvec2[3](uvec2(1u, 2u),
2738 lowp uvec2 y[3] = x;
2746 case equal_mediump_uvec3_lowp_uvec3
2750 output bool success = true;
2755 precision mediump float;
2760 mediump uvec3 x[3] = uvec3[3](uvec3(1u, 2u, 3u),
2763 lowp uvec3 y[3] = x;
2771 case equal_mediump_uvec4_lowp_uvec4
2775 output bool success = true;
2780 precision mediump float;
2785 mediump uvec4 x[3] = uvec4[3](uvec4(1u, 2u, 3u, 4u),
2786 uvec4(5u, 6u, 7u, 8u),
2787 uvec4(9u, 10u, 11u, 12u));
2788 lowp uvec4 y[3] = x;
2796 case equal_mediump_mat2_lowp_mat2
2800 output bool success = true;
2805 precision mediump float;
2810 mediump mat2 x[3] = mat2[3](mat2(1.0, 2.0, 3.0, 4.0),
2811 mat2(5.0, 6.0, 7.0, 8.0),
2812 mat2(9.0, 10.0, 11.0, 12.0));
2821 case equal_mediump_mat3_lowp_mat3
2825 output bool success = true;
2830 precision mediump float;
2835 mediump mat3 x[3] = mat3[3](mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0),
2836 mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0),
2837 mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0));
2846 case equal_mediump_mat4_lowp_mat4
2850 output bool success = true;
2855 precision mediump float;
2860 mediump mat4 x[3] = mat4[3](mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0),
2861 mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0),
2862 mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0));
2871 case equal_mediump_int_mediump_int
2875 output bool success = true;
2880 precision mediump float;
2885 mediump int x[3] = int[3](1, 2, 3);
2886 mediump int y[3] = x;
2894 case equal_mediump_uint_mediump_uint
2898 output bool success = true;
2903 precision mediump float;
2908 mediump uint x[3] = uint[3](1u, 2u, 3u);
2909 mediump uint y[3] = x;
2917 case equal_mediump_float_mediump_float
2921 output bool success = true;
2926 precision mediump float;
2931 mediump float x[3] = float[3](1.0, 2.0, 3.0);
2932 mediump float y[3] = x;
2940 case equal_mediump_vec2_mediump_vec2
2944 output bool success = true;
2949 precision mediump float;
2954 mediump vec2 x[3] = vec2[3](vec2(1.0, 2.0),
2957 mediump vec2 y[3] = x;
2965 case equal_mediump_vec3_mediump_vec3
2969 output bool success = true;
2974 precision mediump float;
2979 mediump vec3 x[3] = vec3[3](vec3(1.0, 2.0, 3.0),
2980 vec3(4.0, 5.0, 6.0),
2981 vec3(7.0, 8.0, 9.0));
2982 mediump vec3 y[3] = x;
2990 case equal_mediump_vec4_mediump_vec4
2994 output bool success = true;
2999 precision mediump float;
3004 mediump vec4 x[3] = vec4[3](vec4(1.0, 2.0, 3.0, 4.0),
3005 vec4(5.0, 6.0, 7.0, 8.0),
3006 vec4(9.0, 10.0, 11.0, 12.0));
3007 mediump vec4 y[3] = x;
3015 case equal_mediump_ivec2_mediump_ivec2
3019 output bool success = true;
3024 precision mediump float;
3029 mediump ivec2 x[3] = ivec2[3](ivec2(1, 2),
3032 mediump ivec2 y[3] = x;
3040 case equal_mediump_ivec3_mediump_ivec3
3044 output bool success = true;
3049 precision mediump float;
3054 mediump ivec3 x[3] = ivec3[3](ivec3(1, 2, 3),
3057 mediump ivec3 y[3] = x;
3065 case equal_mediump_ivec4_mediump_ivec4
3069 output bool success = true;
3074 precision mediump float;
3079 mediump ivec4 x[3] = ivec4[3](ivec4(1, 2, 3, 4),
3081 ivec4(9, 10, 11, 12));
3082 mediump ivec4 y[3] = x;
3090 case equal_mediump_uvec2_mediump_uvec2
3094 output bool success = true;
3099 precision mediump float;
3104 mediump uvec2 x[3] = uvec2[3](uvec2(1u, 2u),
3107 mediump uvec2 y[3] = x;
3115 case equal_mediump_uvec3_mediump_uvec3
3119 output bool success = true;
3124 precision mediump float;
3129 mediump uvec3 x[3] = uvec3[3](uvec3(1u, 2u, 3u),
3132 mediump uvec3 y[3] = x;
3140 case equal_mediump_uvec4_mediump_uvec4
3144 output bool success = true;
3149 precision mediump float;
3154 mediump uvec4 x[3] = uvec4[3](uvec4(1u, 2u, 3u, 4u),
3155 uvec4(5u, 6u, 7u, 8u),
3156 uvec4(9u, 10u, 11u, 12u));
3157 mediump uvec4 y[3] = x;
3165 case equal_mediump_mat2_mediump_mat2
3169 output bool success = true;
3174 precision mediump float;
3179 mediump mat2 x[3] = mat2[3](mat2(1.0, 2.0, 3.0, 4.0),
3180 mat2(5.0, 6.0, 7.0, 8.0),
3181 mat2(9.0, 10.0, 11.0, 12.0));
3182 mediump mat2 y[3] = x;
3190 case equal_mediump_mat3_mediump_mat3
3194 output bool success = true;
3199 precision mediump float;
3204 mediump mat3 x[3] = mat3[3](mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0),
3205 mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0),
3206 mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0));
3207 mediump mat3 y[3] = x;
3215 case equal_mediump_mat4_mediump_mat4
3219 output bool success = true;
3224 precision mediump float;
3229 mediump mat4 x[3] = mat4[3](mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0),
3230 mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0),
3231 mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0));
3232 mediump mat4 y[3] = x;
3240 case equal_highp_int_mediump_int
3244 output bool success = true;
3249 precision highp float;
3254 highp int x[3] = int[3](1, 2, 3);
3255 mediump int y[3] = x;
3263 case equal_highp_uint_mediump_uint
3267 output bool success = true;
3272 precision highp float;
3277 highp uint x[3] = uint[3](1u, 2u, 3u);
3278 mediump uint y[3] = x;
3286 case equal_highp_float_mediump_float
3290 output bool success = true;
3295 precision highp float;
3300 highp float x[3] = float[3](1.0, 2.0, 3.0);
3301 mediump float y[3] = x;
3309 case equal_highp_vec2_mediump_vec2
3313 output bool success = true;
3318 precision highp float;
3323 highp vec2 x[3] = vec2[3](vec2(1.0, 2.0),
3326 mediump vec2 y[3] = x;
3334 case equal_highp_vec3_mediump_vec3
3338 output bool success = true;
3343 precision highp float;
3348 highp vec3 x[3] = vec3[3](vec3(1.0, 2.0, 3.0),
3349 vec3(4.0, 5.0, 6.0),
3350 vec3(7.0, 8.0, 9.0));
3351 mediump vec3 y[3] = x;
3359 case equal_highp_vec4_mediump_vec4
3363 output bool success = true;
3368 precision highp float;
3373 highp vec4 x[3] = vec4[3](vec4(1.0, 2.0, 3.0, 4.0),
3374 vec4(5.0, 6.0, 7.0, 8.0),
3375 vec4(9.0, 10.0, 11.0, 12.0));
3376 mediump vec4 y[3] = x;
3384 case equal_highp_ivec2_mediump_ivec2
3388 output bool success = true;
3393 precision highp float;
3398 highp ivec2 x[3] = ivec2[3](ivec2(1, 2),
3401 mediump ivec2 y[3] = x;
3409 case equal_highp_ivec3_mediump_ivec3
3413 output bool success = true;
3418 precision highp float;
3423 highp ivec3 x[3] = ivec3[3](ivec3(1, 2, 3),
3426 mediump ivec3 y[3] = x;
3434 case equal_highp_ivec4_mediump_ivec4
3438 output bool success = true;
3443 precision highp float;
3448 highp ivec4 x[3] = ivec4[3](ivec4(1, 2, 3, 4),
3450 ivec4(9, 10, 11, 12));
3451 mediump ivec4 y[3] = x;
3459 case equal_highp_uvec2_mediump_uvec2
3463 output bool success = true;
3468 precision highp float;
3473 highp uvec2 x[3] = uvec2[3](uvec2(1u, 2u),
3476 mediump uvec2 y[3] = x;
3484 case equal_highp_uvec3_mediump_uvec3
3488 output bool success = true;
3493 precision highp float;
3498 highp uvec3 x[3] = uvec3[3](uvec3(1u, 2u, 3u),
3501 mediump uvec3 y[3] = x;
3509 case equal_highp_uvec4_mediump_uvec4
3513 output bool success = true;
3518 precision highp float;
3523 highp uvec4 x[3] = uvec4[3](uvec4(1u, 2u, 3u, 4u),
3524 uvec4(5u, 6u, 7u, 8u),
3525 uvec4(9u, 10u, 11u, 12u));
3526 mediump uvec4 y[3] = x;
3534 case equal_highp_mat2_mediump_mat2
3538 output bool success = true;
3543 precision highp float;
3548 highp mat2 x[3] = mat2[3](mat2(1.0, 2.0, 3.0, 4.0),
3549 mat2(5.0, 6.0, 7.0, 8.0),
3550 mat2(9.0, 10.0, 11.0, 12.0));
3551 mediump mat2 y[3] = x;
3559 case equal_highp_mat3_mediump_mat3
3563 output bool success = true;
3568 precision highp float;
3573 highp mat3 x[3] = mat3[3](mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0),
3574 mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0),
3575 mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0));
3576 mediump mat3 y[3] = x;
3584 case equal_highp_mat4_mediump_mat4
3588 output bool success = true;
3593 precision highp float;
3598 highp mat4 x[3] = mat4[3](mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0),
3599 mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0),
3600 mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0));
3601 mediump mat4 y[3] = x;
3609 case equal_highp_int_lowp_int
3613 output bool success = true;
3618 precision highp float;
3623 highp int x[3] = int[3](1, 2, 3);
3632 case equal_highp_uint_lowp_uint
3636 output bool success = true;
3641 precision highp float;
3646 highp uint x[3] = uint[3](1u, 2u, 3u);
3655 case equal_highp_float_lowp_float
3659 output bool success = true;
3664 precision highp float;
3669 highp float x[3] = float[3](1.0, 2.0, 3.0);
3670 lowp float y[3] = x;
3678 case equal_highp_vec2_lowp_vec2
3682 output bool success = true;
3687 precision highp float;
3692 highp vec2 x[3] = vec2[3](vec2(1.0, 2.0),
3703 case equal_highp_vec3_lowp_vec3
3707 output bool success = true;
3712 precision highp float;
3717 highp vec3 x[3] = vec3[3](vec3(1.0, 2.0, 3.0),
3718 vec3(4.0, 5.0, 6.0),
3719 vec3(7.0, 8.0, 9.0));
3728 case equal_highp_vec4_lowp_vec4
3732 output bool success = true;
3737 precision highp float;
3742 highp vec4 x[3] = vec4[3](vec4(1.0, 2.0, 3.0, 4.0),
3743 vec4(5.0, 6.0, 7.0, 8.0),
3744 vec4(9.0, 10.0, 11.0, 12.0));
3753 case equal_highp_ivec2_lowp_ivec2
3757 output bool success = true;
3762 precision highp float;
3767 highp ivec2 x[3] = ivec2[3](ivec2(1, 2),
3770 lowp ivec2 y[3] = x;
3778 case equal_highp_ivec3_lowp_ivec3
3782 output bool success = true;
3787 precision highp float;
3792 highp ivec3 x[3] = ivec3[3](ivec3(1, 2, 3),
3795 lowp ivec3 y[3] = x;
3803 case equal_highp_ivec4_lowp_ivec4
3807 output bool success = true;
3812 precision highp float;
3817 highp ivec4 x[3] = ivec4[3](ivec4(1, 2, 3, 4),
3819 ivec4(9, 10, 11, 12));
3820 lowp ivec4 y[3] = x;
3828 case equal_highp_uvec2_lowp_uvec2
3832 output bool success = true;
3837 precision highp float;
3842 highp uvec2 x[3] = uvec2[3](uvec2(1u, 2u),
3845 lowp uvec2 y[3] = x;
3853 case equal_highp_uvec3_lowp_uvec3
3857 output bool success = true;
3862 precision highp float;
3867 highp uvec3 x[3] = uvec3[3](uvec3(1u, 2u, 3u),
3870 lowp uvec3 y[3] = x;
3878 case equal_highp_uvec4_lowp_uvec4
3882 output bool success = true;
3887 precision highp float;
3892 highp uvec4 x[3] = uvec4[3](uvec4(1u, 2u, 3u, 4u),
3893 uvec4(5u, 6u, 7u, 8u),
3894 uvec4(9u, 10u, 11u, 12u));
3895 lowp uvec4 y[3] = x;
3903 case equal_highp_mat2_lowp_mat2
3907 output bool success = true;
3912 precision highp float;
3917 highp mat2 x[3] = mat2[3](mat2(1.0, 2.0, 3.0, 4.0),
3918 mat2(5.0, 6.0, 7.0, 8.0),
3919 mat2(9.0, 10.0, 11.0, 12.0));
3928 case equal_highp_mat3_lowp_mat3
3932 output bool success = true;
3937 precision highp float;
3942 highp mat3 x[3] = mat3[3](mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0),
3943 mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0),
3944 mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0));
3953 case equal_highp_mat4_lowp_mat4
3957 output bool success = true;
3962 precision highp float;
3967 highp mat4 x[3] = mat4[3](mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0),
3968 mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0),
3969 mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0));
3978 case equal_highp_int_highp_int
3982 output bool success = true;
3987 precision highp float;
3992 highp int x[3] = int[3](1, 2, 3);
4001 case equal_highp_uint_highp_uint
4005 output bool success = true;
4010 precision highp float;
4015 highp uint x[3] = uint[3](1u, 2u, 3u);
4016 highp uint y[3] = x;
4024 case equal_highp_float_highp_float
4028 output bool success = true;
4033 precision highp float;
4038 highp float x[3] = float[3](1.0, 2.0, 3.0);
4039 highp float y[3] = x;
4047 case equal_highp_vec2_highp_vec2
4051 output bool success = true;
4056 precision highp float;
4061 highp vec2 x[3] = vec2[3](vec2(1.0, 2.0),
4064 highp vec2 y[3] = x;
4072 case equal_highp_vec3_highp_vec3
4076 output bool success = true;
4081 precision highp float;
4086 highp vec3 x[3] = vec3[3](vec3(1.0, 2.0, 3.0),
4087 vec3(4.0, 5.0, 6.0),
4088 vec3(7.0, 8.0, 9.0));
4089 highp vec3 y[3] = x;
4097 case equal_highp_vec4_highp_vec4
4101 output bool success = true;
4106 precision highp float;
4111 highp vec4 x[3] = vec4[3](vec4(1.0, 2.0, 3.0, 4.0),
4112 vec4(5.0, 6.0, 7.0, 8.0),
4113 vec4(9.0, 10.0, 11.0, 12.0));
4114 highp vec4 y[3] = x;
4122 case equal_highp_ivec2_highp_ivec2
4126 output bool success = true;
4131 precision highp float;
4136 highp ivec2 x[3] = ivec2[3](ivec2(1, 2),
4139 highp ivec2 y[3] = x;
4147 case equal_highp_ivec3_highp_ivec3
4151 output bool success = true;
4156 precision highp float;
4161 highp ivec3 x[3] = ivec3[3](ivec3(1, 2, 3),
4164 highp ivec3 y[3] = x;
4172 case equal_highp_ivec4_highp_ivec4
4176 output bool success = true;
4181 precision highp float;
4186 highp ivec4 x[3] = ivec4[3](ivec4(1, 2, 3, 4),
4188 ivec4(9, 10, 11, 12));
4189 highp ivec4 y[3] = x;
4197 case equal_highp_uvec2_highp_uvec2
4201 output bool success = true;
4206 precision highp float;
4211 highp uvec2 x[3] = uvec2[3](uvec2(1u, 2u),
4214 highp uvec2 y[3] = x;
4222 case equal_highp_uvec3_highp_uvec3
4226 output bool success = true;
4231 precision highp float;
4236 highp uvec3 x[3] = uvec3[3](uvec3(1u, 2u, 3u),
4239 highp uvec3 y[3] = x;
4247 case equal_highp_uvec4_highp_uvec4
4251 output bool success = true;
4256 precision highp float;
4261 highp uvec4 x[3] = uvec4[3](uvec4(1u, 2u, 3u, 4u),
4262 uvec4(5u, 6u, 7u, 8u),
4263 uvec4(9u, 10u, 11u, 12u));
4264 highp uvec4 y[3] = x;
4272 case equal_highp_mat2_highp_mat2
4276 output bool success = true;
4281 precision highp float;
4286 highp mat2 x[3] = mat2[3](mat2(1.0, 2.0, 3.0, 4.0),
4287 mat2(5.0, 6.0, 7.0, 8.0),
4288 mat2(9.0, 10.0, 11.0, 12.0));
4289 highp mat2 y[3] = x;
4297 case equal_highp_mat3_highp_mat3
4301 output bool success = true;
4306 precision highp float;
4311 highp mat3 x[3] = mat3[3](mat3(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0),
4312 mat3(10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0),
4313 mat3(19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0));
4314 highp mat3 y[3] = x;
4322 case equal_highp_mat4_highp_mat4
4326 output bool success = true;
4331 precision highp float;
4336 highp mat4 x[3] = mat4[3](mat4(1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0),
4337 mat4(17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0),
4338 mat4(33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0));
4339 highp mat4 y[3] = x;