1 #X1. Constructor tests test constructing arrays of arrays with different declaration syntax and data types.
2 #X2. Return value tests test arrays of arrays as function return values.
3 #X3. Parameter tests test arrays of arrays as different types of function parameters (in, out, unnamed).
4 #X4. Implicit size tests test constructing arrays of arrays with implicit size.
5 #X5. Assignment tests test assigning an array of arrays to another array of arrays variable.
6 #X6. Length tests test the length method of arrays of arrays.
7 #X8. Array access tests test array element access at initialization with const/dynamic values
9 group constructor "Array of arrays constructors"
11 group explicit "Testing constructors with explicit sizes"
14 desc "Testing constructing explicitly sized arrays of arrays"
17 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
18 output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
23 precision mediump float;
30 x = float[3][3] ( float[3] (in0.z, in0.x, in0.y),
31 float[3] (in0.z, in0.x, in0.y),
32 float[3] (in0.z, in0.x, in0.y) );
33 out0 = vec3(x[0][0], x[1][1], x[2][2]);
41 desc "Testing constructing explicitly sized arrays of arrays"
44 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) ];
45 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) ];
50 precision mediump float;
57 x = float[3][4] ( float[4] (in0.z, in0.x, in0.w, in0.y),
58 float[4] (in0.z, in0.x, in0.w, in0.y),
59 float[4] (in0.z, in0.x, in0.w, in0.y) );
60 out0 = vec4(x[0][0], x[1][1], x[2][2], x[2][3]);
68 desc "Testing constructing explicitly sized arrays of arrays"
71 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
72 output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
77 precision mediump int;
78 precision mediump float;
85 x = int[3][1] ( int[1] (in0.z),
88 out0 = ivec3(x[0][0], x[1][0], x[2][0]);
96 desc "Testing constructing explicitly sized arrays of arrays"
99 input ivec4 in0 = [ ivec4(0, 1, 2, 0) | ivec4(7, -1, 2, -1) | ivec4(3, 1, -2, 0) ];
100 output ivec4 out0 = [ ivec4(2, 0, 0, 1) | ivec4(2, 7, -1, -1) | ivec4(-2, 3, 0, 1) ];
105 precision mediump int;
106 precision mediump float;
113 x = int[4][4][4] ( int[4][4] ( (int[4] (in0.z, in0.x, in0.w, in0.y)),
114 (int[4] (in0.z, in0.x, in0.w, in0.y)),
115 (int[4] (in0.z, in0.x, in0.w, in0.y)),
116 (int[4] (in0.z, in0.x, in0.w, in0.y))),
118 int[4][4] ( (int[4] (in0.z, in0.x, in0.w, in0.y)),
119 (int[4] (in0.z, in0.x, in0.w, in0.y)),
120 (int[4] (in0.z, in0.x, in0.w, in0.y)),
121 (int[4] (in0.z, in0.x, in0.w, in0.y))),
123 int[4][4] ( (int[4] (in0.z, in0.x, in0.w, in0.y)),
124 (int[4] (in0.z, in0.x, in0.w, in0.y)),
125 (int[4] (in0.z, in0.x, in0.w, in0.y)),
126 (int[4] (in0.z, in0.x, in0.w, in0.y))),
128 int[4][4] ( (int[4] (in0.z, in0.x, in0.w, in0.y)),
129 (int[4] (in0.z, in0.x, in0.w, in0.y)),
130 (int[4] (in0.z, in0.x, in0.w, in0.y)),
131 (int[4] (in0.z, in0.x, in0.w, in0.y))) );
133 out0 = ivec4(x[0][0][0], x[1][1][1], x[2][2][2], x[3][3][3]);
141 desc "Testing constructing explicitly sized arrays of arrays"
144 input bvec3 in0 = [ bvec3(true, true, false) ];
145 output bvec3 out0 = [ bvec3(false, true, true) ];
150 precision mediump float;
157 x = bool[3][3][3] ( bool[3][3] ((bool[3] (in0.y, in0.y, in0.y)),
158 (bool[3] (in0.z, in0.z, in0.z)),
159 (bool[3] (in0.x, in0.x, in0.x))),
161 bool[3][3] ((bool[3] (in0.y, in0.y, in0.y)),
162 (bool[3] (in0.z, in0.z, in0.z)),
163 (bool[3] (in0.x, in0.x, in0.x))),
165 bool[3][3] ((bool[3] (in0.y, in0.y, in0.y)),
166 (bool[3] (in0.z, in0.z, in0.z)),
167 (bool[3] (in0.x, in0.x, in0.x))) );
169 out0 = bvec3(x[1][1][1], x[0][0][0], x[2][2][2]);
177 desc "Testing constructing explicitly sized arrays of arrays"
180 input bvec4 in0 = [ bvec4(true, true, false, false) ];
181 output bvec4 out0 = [ bvec4(false, true, true, false) ];
186 precision mediump float;
193 x = bool[2][1][4] ( bool[1][4] ((bool[4] (in0.z, in0.x, in0.y, in0.w))),
194 bool[1][4] ((bool[4] (in0.z, in0.x, in0.y, in0.w))) );
195 out0 = bvec4(x[0][0][0], x[0][0][1], x[1][0][2], x[1][0][3]);
203 desc "Testing constructing explicitly sized arrays of arrays"
206 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
207 output vec3 out0 = [ vec3(2.0, -0.5, -1.0) ];
212 precision mediump float;
225 Test a = Test(in0.z, vec3(in0.x, in0.y, in0.z));
226 Test b = Test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
227 Test c = Test(in0.x, vec3(-in0.y, in0.z, -in0.x));
229 Test[2] x[3] = Test[3][2] ( (Test[2] (a, b)),
233 out0 = vec3(x[0][0].f, x[0][1].v.y, x[2][1].v.x);
241 desc "Testing constructing explicitly sized arrays of arrays"
244 input vec4 in0 = [ vec4(0.5, 1.0, 2.0, 1.5) ];
245 output vec4 out0 = [ vec4(2.0, -0.5, -1.0, -1.5) ];
250 precision mediump float;
263 Test a = Test(in0.z, vec3(in0.x, in0.y, in0.z));
264 Test b = Test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
265 Test c = Test(in0.x, vec3(-in0.y, in0.z, -in0.x));
266 Test d = Test(-in0.w, vec3(-in0.w, -in0.x, -in0.z));
268 Test[4] x[4][1] = Test[4][1][4] ( (Test[1][4] (Test[4] (a, b, c, d))),
269 (Test[1][4] (Test[4] (a, b, c, d))),
270 (Test[1][4] (Test[4] (a, b, c, d))),
271 (Test[1][4] (Test[4] (a, b, c, d))) );
273 out0 = vec4(x[0][0][0].f, x[1][0][1].v.y, x[2][0][2].v.x, x[3][0][3].v.x);
281 desc "Testing constructing explicitly sized arrays of arrays"
284 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
285 output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(7.4, -2.0, -1.0) | vec3(3.0, 2.0, 1.6) ];
290 precision mediump float;
298 x = vec3[4][3] (vec3[3] ( vec3(in0.x, in0.y, in0.z),
299 vec3(-in0.y, -in0.z, -in0.x),
300 vec3(in0.z, in0.x, in0.y)),
301 vec3[3] ( vec3(in0.x, in0.y, in0.z),
302 vec3(-in0.y, -in0.z, -in0.x),
303 vec3(in0.z, in0.x, in0.y)),
304 vec3[3] ( vec3(in0.x, in0.y, in0.z),
305 vec3(-in0.y, -in0.z, -in0.x),
306 vec3(in0.z, in0.x, in0.y)),
307 vec3[3] ( vec3(in0.x, in0.y, in0.z),
308 vec3(-in0.y, -in0.z, -in0.x),
309 vec3(in0.z, in0.x, in0.y)) );
311 out0 = vec3(x[0][0].x, x[1][1].y, x[3][2].z);
319 desc "Testing constructing explicitly sized arrays of arrays"
322 input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
323 output ivec3 out0 = [ ivec3(5, -2, 1) | ivec3(7, -2, -1) | ivec3(3, 2, 1) ];
328 precision mediump int;
329 precision mediump float;
337 x = ivec3[3][2][1] (ivec3[2][1] ( ivec3[1] (ivec3(in0.x, in0.y, in0.z)),
338 ivec3[1] (ivec3(-in0.y, -in0.z, -in0.x))),
339 ivec3[2][1] ( ivec3[1] (ivec3(in0.z, in0.x, in0.y)),
340 ivec3[1] (ivec3(in0.x, in0.y, in0.z))),
341 ivec3[2][1] ( ivec3[1] (ivec3(-in0.y, -in0.z, -in0.x)),
342 ivec3[1] (ivec3(in0.z, in0.x, in0.y))) );
344 out0 = ivec3(x[0][0][0].x, x[2][0][0].y, x[1][0][0].z);
352 desc "Testing constructing explicitly sized arrays of arrays"
355 input bvec3 in0 = [ bvec3(true, false, true) ];
356 output bvec3 out0 = [ bvec3(true, true, false) ];
361 precision mediump float;
369 x = bvec3[1][2][3] ( bvec3[2][3] ( bvec3[3] ( bvec3(in0.x, in0.y, in0.z),
370 bvec3(in0.y, in0.z, in0.x),
371 bvec3(in0.z, in0.x, in0.y)),
373 bvec3[3] ( bvec3(in0.z, in0.x, in0.y),
374 bvec3(in0.x, in0.y, in0.z),
375 bvec3(in0.y, in0.z, in0.x)) ));
377 out0 = bvec3(x[0][0][0].x, x[0][0][1].y, x[0][1][0].z);
385 desc "Testing constructing explicitly sized arrays of arrays"
388 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
389 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
394 precision mediump float;
400 mat3[3][2] a = mat3[3][2] ( mat3[2] ( mat3( in0.x, in0.y, in0.z,
402 in0.x, in0.y, in0.z),
403 mat3( in0.z, in0.x, -in0.y,
404 in0.z, in0.x, -in0.y,
405 in0.z, in0.x, -in0.y)),
407 mat3[2] ( mat3( -in0.z, -in0.z, in0.z,
408 -in0.y, -in0.y, in0.y,
409 -in0.x, -in0.x, in0.x),
410 mat3( in0.x, in0.y, in0.z,
412 in0.x, in0.y, in0.z)),
414 mat3[2] ( mat3( in0.z, in0.x, -in0.y,
415 in0.z, in0.x, -in0.y,
416 in0.z, in0.x, -in0.y),
417 mat3( -in0.z, -in0.z, in0.z,
418 -in0.y, -in0.y, in0.y,
419 -in0.x, -in0.x, in0.x)) );
425 float ret0 = a0[2][0];
426 float ret1 = a1[0][2];
427 float ret2 = a2[1][2];
429 out0 = vec3(ret0, ret1, ret2);
437 desc "Testing constructing explicitly sized arrays of arrays"
440 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
441 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
446 precision mediump int;
447 precision mediump float;
454 mat3 a = mat3( in0.x, in0.y, in0.z,
456 in0.x, in0.y, in0.z);
457 mat3 b = mat3( in0.z, in0.x, -in0.y,
458 in0.z, in0.x, -in0.y,
459 in0.z, in0.x, -in0.y);
460 mat3 c = mat3( -in0.z, -in0.z, in0.z,
461 -in0.y, -in0.y, in0.y,
462 -in0.x, -in0.x, in0.x);
464 mat3[3][3][3] x = mat3[3][3][3] ( mat3[3][3] (mat3[3] (a, a, a),
468 mat3[3][3] (mat3[3] (b, b, b),
472 mat3[3][3] (mat3[3] (c, c, c),
474 mat3[3] (b, b, b)) );
476 mat3 x0 = x[0][0][0];
477 mat3 x1 = x[1][0][0];
478 mat3 x2 = x[2][0][0];
480 float ret0 = x0[2][0];
481 float ret1 = x1[0][2];
482 float ret2 = x2[1][2];
484 out0 = ivec3(ret0, ret1, ret2);
492 desc "Testing constructing explicitly sized arrays of arrays"
495 input bvec3 in0 = [ bvec3(true, false, true) ];
496 output bvec3 out0 = [ bvec3(true, false, false) ];
501 precision mediump float;
508 mat3 a = mat3( in0.x, in0.y, in0.z,
510 in0.x, in0.y, in0.z);
512 mat3 b = mat3( in0.z, in0.x, in0.y,
514 in0.z, in0.x, in0.y);
516 mat3 c = mat3( in0.z, in0.z, in0.z,
518 in0.x, in0.x, in0.x);
520 mat3[4] x[3] = mat3[3][4] ( mat3[4] (a, b, c, a),
521 mat3[4] (b, c, a, b),
522 mat3[4] (c, a, b, c) );
528 float ret0 = x0[2][0];
529 float ret1 = x1[0][2];
530 float ret2 = x2[1][2];
532 out0 = bvec3(ret0, ret1, ret2);
538 case high_dimensional_array
540 desc "Testing constructing explicitly sized arrays of arrays"
543 input ivec2 in0 = [ ivec2(1, -2) ];
544 output ivec2 out0 = [ ivec2(-2, 1) ];
549 precision mediump float;
556 int[1][1][1][2][1][1][1] x = int[1][1][1][2][1][1][1] ( int[1][1][2][1][1][1] (int [1][2][1][1][1] ( int[2][1][1][1] ( int[1][1][1] ( int[1][1] (int[1] (in0.y))),
557 int[1][1][1] ( int[1][1] (int[1] (in0.x)))))));
559 out0 = ivec2(x[0][0][0][0][0][0][0], x[0][0][0][1][0][0][0]);
567 group implicit "Testing constructors with implicit size"
571 desc "Testing constructing implicitly sized arrays of arrays"
574 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
575 output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
580 precision mediump float;
587 x = float[][] ( float[](in0.z, in0.x, in0.y),
588 float[](in0.z, in0.x, in0.y),
589 float[](in0.z, in0.x, in0.y) );
591 out0 = vec3(x[0][0], x[1][1], x[2][2]);
599 desc "Testing constructing implicitly sized arrays of arrays"
602 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) ];
603 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) ];
608 precision mediump float;
615 x = float[][] ( float[] (in0.z, in0.x, in0.w, in0.y),
616 float[] (in0.z, in0.x, in0.w, in0.y),
617 float[] (in0.z, in0.x, in0.w, in0.y) );
619 out0 = vec4(x[0][0], x[1][1], x[2][2], x[2][3]);
627 desc "Testing constructing implicitly sized arrays of arrays"
630 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
631 output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
636 precision mediump int;
637 precision mediump float;
644 x = int[][] ( int[] (in0.z),
648 out0 = ivec3(x[0][0], x[1][0], x[2][0]);
656 desc "Testing constructing implicitly sized arrays of arrays"
659 input ivec4 in0 = [ ivec4(0, 1, 2, 0) | ivec4(7, -1, 2, -1) | ivec4(3, 1, -2, 0) ];
660 output ivec4 out0 = [ ivec4(2, 0, 0, 1) | ivec4(2, 7, -1, -1) | ivec4(-2, 3, 0, 1) ];
665 precision mediump int;
666 precision mediump float;
673 x = int[][][] ( int[][] ((int[] (in0.z, in0.x, in0.w, in0.y)),
674 (int[] (in0.z, in0.x, in0.w, in0.y)),
675 (int[] (in0.z, in0.x, in0.w, in0.y)),
676 (int[] (in0.z, in0.x, in0.w, in0.y))),
678 int[][] ((int[] (in0.z, in0.x, in0.w, in0.y)),
679 (int[] (in0.z, in0.x, in0.w, in0.y)),
680 (int[] (in0.z, in0.x, in0.w, in0.y)),
681 (int[] (in0.z, in0.x, in0.w, in0.y))),
683 int[][] ((int[] (in0.z, in0.x, in0.w, in0.y)),
684 (int[] (in0.z, in0.x, in0.w, in0.y)),
685 (int[] (in0.z, in0.x, in0.w, in0.y)),
686 (int[] (in0.z, in0.x, in0.w, in0.y))),
688 int[][] ((int[] (in0.z, in0.x, in0.w, in0.y)),
689 (int[] (in0.z, in0.x, in0.w, in0.y)),
690 (int[] (in0.z, in0.x, in0.w, in0.y)),
691 (int[] (in0.z, in0.x, in0.w, in0.y))) );
693 out0 = ivec4(x[0][0][0], x[1][1][1], x[2][2][2], x[3][3][3]);
701 desc "Testing constructing implicitly sized arrays of arrays"
704 input bvec3 in0 = [ bvec3(true, true, false) ];
705 output bvec3 out0 = [ bvec3(false, true, true) ];
710 precision mediump float;
717 x = bool[][][] (bool[][] ( (bool[] (in0.y, in0.y, in0.y)),
718 (bool[] (in0.z, in0.z, in0.z)),
719 (bool[] (in0.x, in0.x, in0.x))),
721 bool[][] ( (bool[] (in0.y, in0.y, in0.y)),
722 (bool[] (in0.z, in0.z, in0.z)),
723 (bool[] (in0.x, in0.x, in0.x))),
725 bool[][] ( (bool[] (in0.y, in0.y, in0.y)),
726 (bool[] (in0.z, in0.z, in0.z)),
727 (bool[] (in0.x, in0.x, in0.x))) );
729 out0 = bvec3(x[1][1][1], x[0][0][0], x[2][2][2]);
737 desc "Testing constructing implicitly sized arrays of arrays"
740 input bvec4 in0 = [ bvec4(true, true, false, false) ];
741 output bvec4 out0 = [ bvec4(false, true, true, false) ];
746 precision mediump float;
753 x = bool[2][1][4] ( bool[][] ((bool[] (in0.z, in0.x, in0.y, in0.w))),
754 bool[][] ((bool[] (in0.z, in0.x, in0.y, in0.w))) );
755 out0 = bvec4(x[0][0][0], x[0][0][1], x[1][0][2], x[1][0][3]);
763 desc "Testing constructing implicitly sized arrays of arrays"
766 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
767 output vec3 out0 = [ vec3(2.0, -0.5, -1.0) ];
772 precision mediump float;
785 Test a = Test(in0.z, vec3(in0.x, in0.y, in0.z));
786 Test b = Test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
787 Test c = Test(in0.x, vec3(-in0.y, in0.z, -in0.x));
789 Test[2] x[3] = Test[][] ( (Test[] (a, b)),
793 out0 = vec3(x[0][0].f, x[0][1].v.y, x[2][1].v.x);
801 desc "Testing constructing implicitly sized arrays of arrays"
804 input vec4 in0 = [ vec4(0.5, 1.0, 2.0, 1.5) ];
805 output vec4 out0 = [ vec4(2.0, -0.5, -1.0, -1.5) ];
810 precision mediump float;
824 Test a = Test(in0.z, vec3(in0.x, in0.y, in0.z));
825 Test b = Test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
826 Test c = Test(in0.x, vec3(-in0.y, in0.z, -in0.x));
827 Test d = Test(-in0.w, vec3(-in0.w, -in0.x, -in0.z));
829 Test[4] x[4][1] = Test[][][] ( (Test[][] (Test[] (a, b, c, d))),
830 (Test[][] (Test[] (a, b, c, d))),
831 (Test[][] (Test[] (a, b, c, d))),
832 (Test[][] (Test[] (a, b, c, d))) );
834 out0 = vec4(x[0][0][0].f, x[1][0][1].v.y, x[2][0][2].v.x, x[3][0][3].v.x);
842 desc "Testing constructing implicitly sized arrays of arrays"
845 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
846 output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(7.4, -2.0, -1.0) | vec3(3.0, 2.0, 1.6) ];
851 precision mediump float;
859 x = vec3[][] ( vec3[] ( vec3(in0.x, in0.y, in0.z),
860 vec3(-in0.y, -in0.z, -in0.x),
861 vec3(in0.z, in0.x, in0.y)),
862 vec3[] ( vec3(in0.x, in0.y, in0.z),
863 vec3(-in0.y, -in0.z, -in0.x),
864 vec3(in0.z, in0.x, in0.y)),
866 vec3[] ( vec3(in0.x, in0.y, in0.z),
867 vec3(-in0.y, -in0.z, -in0.x),
868 vec3(in0.z, in0.x, in0.y)),
870 vec3[] ( vec3(in0.x, in0.y, in0.z),
871 vec3(-in0.y, -in0.z, -in0.x),
872 vec3(in0.z, in0.x, in0.y)) );
874 out0 = vec3(x[0][0].x, x[1][1].y, x[3][2].z);
882 desc "Testing constructing implicitly sized arrays of arrays"
885 input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
886 output ivec3 out0 = [ ivec3(5, -2, 1) | ivec3(7, -2, -1) | ivec3(3, 2, 1) ];
891 precision mediump int;
892 precision mediump float;
900 x = ivec3[][][] ( ivec3[][] ( ivec3[] (ivec3(in0.x, in0.y, in0.z)),
901 ivec3[] (ivec3(-in0.y, -in0.z, -in0.x))),
902 ivec3[][] ( ivec3[] (ivec3(in0.z, in0.x, in0.y)),
903 ivec3[] (ivec3(in0.x, in0.y, in0.z))),
904 ivec3[][] ( ivec3[] (ivec3(-in0.y, -in0.z, -in0.x)),
905 ivec3[] (ivec3(in0.z, in0.x, in0.y))) );
906 out0 = ivec3(x[0][0][0].x, x[2][0][0].y, x[1][0][0].z);
914 desc "Testing constructing implicitly sized arrays of arrays"
917 input bvec3 in0 = [ bvec3(true, false, true) ];
918 output bvec3 out0 = [ bvec3(true, true, false) ];
923 precision mediump float;
931 x = bvec3[][][] ( bvec3[][] ( bvec3[] (bvec3(in0.x, in0.y, in0.z),
932 bvec3(in0.y, in0.z, in0.x),
933 bvec3(in0.z, in0.x, in0.y)),
935 bvec3[] (bvec3(in0.z, in0.x, in0.y),
936 bvec3(in0.x, in0.y, in0.z),
937 bvec3(in0.y, in0.z, in0.x)) ));
939 out0 = bvec3(x[0][0][0].x, x[0][0][1].y, x[0][1][0].z);
947 desc "Testing constructing implicitly sized arrays of arrays"
950 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
951 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
956 precision mediump float;
962 mat3[3][2] a = mat3[][] ( mat3[] (mat3( in0.x, in0.y, in0.z,
964 in0.x, in0.y, in0.z),
965 mat3( in0.z, in0.x, -in0.y,
966 in0.z, in0.x, -in0.y,
967 in0.z, in0.x, -in0.y)),
969 mat3[] (mat3( -in0.z, -in0.z, in0.z,
970 -in0.y, -in0.y, in0.y,
971 -in0.x, -in0.x, in0.x),
972 mat3( in0.x, in0.y, in0.z,
974 in0.x, in0.y, in0.z)),
976 mat3[] (mat3( in0.z, in0.x, -in0.y,
977 in0.z, in0.x, -in0.y,
978 in0.z, in0.x, -in0.y),
979 mat3( -in0.z, -in0.z, in0.z,
980 -in0.y, -in0.y, in0.y,
981 -in0.x, -in0.x, in0.x)) );
987 float ret0 = a0[2][0];
988 float ret1 = a1[0][2];
989 float ret2 = a2[1][2];
991 out0 = vec3(ret0, ret1, ret2);
999 desc "Testing constructing implicitly sized arrays of arrays"
1002 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
1003 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
1008 precision mediump int;
1009 precision mediump float;
1016 mat3 a = mat3( in0.x, in0.y, in0.z,
1017 in0.x, in0.y, in0.z,
1018 in0.x, in0.y, in0.z);
1019 mat3 b = mat3( in0.z, in0.x, -in0.y,
1020 in0.z, in0.x, -in0.y,
1021 in0.z, in0.x, -in0.y);
1022 mat3 c = mat3( -in0.z, -in0.z, in0.z,
1023 -in0.y, -in0.y, in0.y,
1024 -in0.x, -in0.x, in0.x);
1026 mat3[3][3][3] x = mat3[][][] ( mat3[][] ( mat3[] (a, a, a),
1030 mat3[][] ( mat3[] (b, b, b),
1034 mat3[][] ( mat3[] (c, c, c),
1036 mat3[] (b, b, b)) );
1038 mat3 x0 = x[0][0][0];
1039 mat3 x1 = x[1][0][0];
1040 mat3 x2 = x[2][0][0];
1042 float ret0 = x0[2][0];
1043 float ret1 = x1[0][2];
1044 float ret2 = x2[1][2];
1046 out0 = ivec3(ret0, ret1, ret2);
1054 desc "Testing constructing implicitly sized arrays of arrays"
1057 input bvec3 in0 = [ bvec3(true, false, true) ];
1058 output bvec3 out0 = [ bvec3(true, false, false) ];
1063 precision mediump float;
1070 mat3 a = mat3( in0.x, in0.y, in0.z,
1071 in0.x, in0.y, in0.z,
1072 in0.x, in0.y, in0.z);
1074 mat3 b = mat3( in0.z, in0.x, in0.y,
1075 in0.z, in0.x, in0.y,
1076 in0.z, in0.x, in0.y);
1078 mat3 c = mat3( in0.z, in0.z, in0.z,
1079 in0.y, in0.y, in0.y,
1080 in0.x, in0.x, in0.x);
1082 mat3[4] x[3] = mat3[][] ( mat3[] (a, b, c, a),
1083 mat3[] (b, c, a, b),
1084 mat3[] (c, a, b, c) );
1090 float ret0 = x0[2][0];
1091 float ret1 = x1[0][2];
1092 float ret2 = x2[1][2];
1094 out0 = bvec3(ret0, ret1, ret2);
1100 case int_high_dimensional_array
1102 desc "Testing constructing implicitly sized arrays of arrays"
1105 input ivec2 in0 = [ ivec2(1, -2) ];
1106 output ivec2 out0 = [ ivec2(-2, 1) ];
1111 precision mediump float;
1118 int[][][][][][][] x = int[][][][][][][] ( int[][][][][][] (int [][][][][] ( int[][][][] ( int[][][] ( int[][] (int[] (in0.y))),
1119 int[][][] ( int[][] (int[] (in0.x)))))));
1121 out0 = ivec2(x[0][0][0][0][0][0][0], x[0][0][0][1][0][0][0]);
1131 group return "Array of arrays as return value"
1133 group explicit "Testing return value with explicit constructor"
1137 desc "Testing arrays of arrays as function return values with explicit array size"
1140 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
1141 output vec3 out0 = [ vec3(2.0, -0.5, 1.0) | vec3(2.0, -7.4, -1.0) | vec3(-2.0, -3.0, 1.6) ];
1146 precision mediump float;
1149 float[3][3] func(vec3 a)
1151 return float[3][3] (float[3] (a.z, 0.0, 0.0),
1152 float[3] (0.0, -a.x, 0.0),
1153 float[3] (0.0, 0.0, a.y) );
1159 float[3][3] x = func(in0);
1160 out0 = vec3(x[0][0], x[1][1], x[2][2]);
1168 desc "Testing arrays of arrays as function return values with explicit array size"
1171 input ivec2 in0 = [ ivec2(4, 1) | ivec2(7, -1) | ivec2(3, 1) ];
1172 output ivec2 out0 = [ ivec2(1, -4) | ivec2(-1, -7) | ivec2(1, -3) ];
1177 precision mediump int;
1178 precision mediump float;
1181 int[2][2][2] func(ivec2 a)
1183 return int[2][2][2] ( int[2][2] ( int[2] (a.y, -a.x),
1185 int[2][2] ( int[2] (0, 0),
1186 int[2] (a.y, -a.x)) );
1192 int[2][2][2] x = func(in0);
1193 out0 = ivec2(x[0][0][0], x[1][1][1]);
1201 desc "Testing arrays of arrays as function return values with explicit array size"
1204 input bvec3 in0 = [ bvec3(false, true, true) ];
1205 output bvec3 out0 = [ bvec3(true, false, true) ];
1210 precision mediump float;
1213 bool[3][2][3] func(bvec3 a)
1215 return bool[3][2][3] ( bool[2][3] (bool[3] (a.z, a.x, a.y),
1216 bool[3] (a.x, a.y, a.z)),
1217 bool[2][3] (bool[3] (a.x, a.y, a.z),
1218 bool[3] (a.z, a.x, a.y)),
1219 bool[2][3] (bool[3] (a.y, a.z, a.x),
1220 bool[3] (a.y, a.z, a.x)) );
1226 bool[3] x[3][2] = func(in0);
1227 out0 = bvec3(x[0][0][0], x[1][1][1], x[2][1][0]);
1236 desc "Testing arrays of arrays as function return values with explicit array size"
1239 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
1240 output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ];
1245 precision mediump float;
1248 vec3[2][3] func(vec3 p)
1250 vec3[2][3] a = vec3[2][3]( vec3[3] (vec3(p.x, p.y, -p.z),
1251 vec3(p.y, -p.z, p.x),
1252 vec3(-p.z, p.x, p.y)),
1253 vec3[3] (vec3(p.y, -p.z, p.x),
1254 vec3(p.x, p.y, -p.z),
1255 vec3(-p.z, p.x, p.y)) );
1257 return vec3[2][3] ( vec3[3] (a[0][1], a[0][2], a[0][0]),
1258 vec3[3] (a[1][1], a[1][2], a[1][0]));
1265 vec3[2][3] x = func(in0);
1266 out0 = vec3(x[0][0].x, x[1][1].y, x[0][2].z);
1274 desc "Testing arrays of arrays as function return values with explicit array size"
1277 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1278 output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ];
1283 precision mediump float;
1292 Test[3][1][3] func(vec3 p)
1294 Test a = Test(p.z, vec3(p.x, p.y, p.z));
1295 Test b = Test(p.y, vec3(-p.z, -p.x, -p.y));
1296 Test c = Test(p.x, vec3(-p.y, p.z, -p.x));
1298 return Test[3][1][3] ( Test[1][3] (Test[3] (b, b, b)),
1299 Test[1][3] (Test[3] (a, a, a)),
1300 Test[1][3] (Test[3] (c, c, c)) );
1306 Test[3][1][3] x = func(in0);
1307 out0 = vec3(x[0][0][0].v.z, x[2][0][2].v.y, x[1][0][1].v.x);
1315 desc "Testing arrays of arrays as function return values with explicit array size"
1318 input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ];
1319 output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ];
1324 precision mediump int;
1325 precision mediump float;
1328 ivec3[3][3] func(ivec3 p)
1330 ivec3[3][3] a = ivec3[3][3] ( ivec3[3] ( ivec3(p.x, p.y, -p.z),
1331 ivec3(p.x, p.y, -p.z),
1332 ivec3(p.x, p.y, -p.z)),
1334 ivec3[3] ( ivec3(p.y, -p.z, p.x),
1335 ivec3(p.y, -p.z, p.x),
1336 ivec3(p.y, -p.z, p.x)),
1338 ivec3[3] ( ivec3(-p.z, p.x, p.y),
1339 ivec3(-p.z, p.x, p.y),
1340 ivec3(-p.z, p.x, p.y)) );
1347 ivec3[3][3] x = func(in0);
1348 out0 = ivec3(x[1][0].x, x[2][0].y, x[0][2].z);
1356 desc "Testing arrays of arrays as function return values with explicit array size"
1359 input bvec4 in0 = [ bvec4(true, false, false, true) ];
1360 output bvec4 out0 = [ bvec4(true, true, false, true) ];
1365 precision mediump int;
1366 precision mediump float;
1369 bvec4[4][2] func(bvec4 p)
1371 bvec4[4] x = bvec4[4]( bvec4(p.x, p.y, p.z, p.w),
1372 bvec4(p.w, p.y, p.z, p.x),
1373 bvec4(p.z, p.w, p.x, p.y),
1374 bvec4(p.y, p.x, p.z, p.w) );
1376 return bvec4[4][2] ( bvec4[2] (bvec4(x[0]),
1379 bvec4[2] (bvec4(x[2]),
1382 bvec4[2] (bvec4(x[1]),
1385 bvec4[2] (bvec4(x[3]),
1392 bvec4[4][2] x = func(in0);
1393 out0 = bvec4(x[0][1].x, x[1][0].y, x[2][0].z, x[3][1].w);
1401 desc "Testing arrays of arrays as function return values with explicit array size"
1404 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
1405 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
1410 precision mediump float;
1413 mat3[3][2] func(vec3 p)
1415 mat3[3][2] a = mat3[3][2] ( mat3[2] (mat3( p.x, p.y, p.z,
1418 mat3( p.z, p.x, -p.y,
1422 mat3[2] (mat3( -p.z, -p.z, p.z,
1425 mat3( p.x, p.y, p.z,
1429 mat3[2] (mat3( p.z, p.x, -p.y,
1432 mat3( -p.z, -p.z, p.z,
1434 -p.x, -p.x, p.x)) );
1443 mat3 a[3][2] = func(in0);
1449 float ret0 = a0[2][0];
1450 float ret1 = a1[0][2];
1451 float ret2 = a2[1][2];
1453 out0 = vec3(ret0, ret1, ret2);
1461 desc "Testing arrays of arrays as function return values with explicit array size"
1464 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
1465 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
1470 precision mediump int;
1471 precision mediump float;
1474 mat3[3][3][3] func(ivec3 p)
1476 mat3 a = mat3( p.x, p.y, p.z,
1479 mat3 b = mat3( p.z, p.x, -p.y,
1482 mat3 c = mat3( -p.z, -p.z, p.z,
1486 return mat3[3][3][3] ( mat3[3][3] (mat3[3] (a, a, a),
1490 mat3[3][3] (mat3[3] (b, b, b),
1494 mat3[3][3] (mat3[3] (c, c, c),
1496 mat3[3] (b, b, b)) );
1503 mat3 x[3][3][3] = func(in0);
1505 mat3 x0 = x[0][0][0];
1506 mat3 x1 = x[1][0][0];
1507 mat3 x2 = x[2][0][0];
1509 float ret0 = x0[2][0];
1510 float ret1 = x1[0][2];
1511 float ret2 = x2[1][2];
1513 out0 = ivec3(ret0, ret1, ret2);
1521 desc "Testing arrays of arrays as function return values with explicit array size"
1524 input bvec3 in0 = [ bvec3(true, false, true) ];
1525 output bvec3 out0 = [ bvec3(true, false, false) ];
1530 precision mediump float;
1533 mat3[3][4] func(bvec3 p)
1535 mat3 a = mat3( p.x, p.y, p.z,
1539 mat3 b = mat3( p.z, p.x, p.y,
1543 mat3 c = mat3( p.z, p.z, p.z,
1547 return mat3[3][4] ( mat3[4] (a, b, c, a),
1548 mat3[4] (b, c, a, b),
1549 mat3[4] (c, a, b, c) );
1556 mat3[4] x[3] = func(in0);
1562 float ret0 = x0[2][0];
1563 float ret1 = x1[0][2];
1564 float ret2 = x2[1][2];
1566 out0 = bvec3(ret0, ret1, ret2);
1574 group implicit "Test return value with implicit constructor"
1578 desc "Testing arrays of arrays as function return values with implicit array size"
1581 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
1582 output vec3 out0 = [ vec3(2.0, -0.5, 1.0) | vec3(2.0, -7.4, -1.0) | vec3(-2.0, -3.0, 1.6) ];
1587 precision mediump float;
1590 float[3][3] func(vec3 a)
1592 return float[][] ( float[] (a.z, 0.0, 0.0),
1593 float[] (0.0, -a.x, 0.0),
1594 float[] (0.0, 0.0, a.y) );
1600 float[3][3] x = func(in0);
1601 out0 = vec3(x[0][0], x[1][1], x[2][2]);
1609 desc "Testing arrays of arrays as function return values with implicit array size"
1612 input ivec2 in0 = [ ivec2(4, 1) | ivec2(7, -1) | ivec2(3, 1) ];
1613 output ivec2 out0 = [ ivec2(1, -4) | ivec2(-1, -7) | ivec2(1, -3) ];
1618 precision mediump int;
1619 precision mediump float;
1622 int[2][2][2] func(ivec2 a)
1624 return int[][][] ( int[][] ( int[] (a.y, -a.x),
1626 int[][] ( int[] (0, 0),
1627 int[] (a.y, -a.x)) );
1633 int[2][2][2] x = func(in0);
1634 out0 = ivec2(x[0][0][0], x[1][1][1]);
1642 desc "Testing arrays of arrays as function return values with implicit array size"
1645 input bvec3 in0 = [ bvec3(false, true, true) ];
1646 output bvec3 out0 = [ bvec3(true, false, true) ];
1651 precision mediump float;
1654 bool[3][2][3] func(bvec3 a)
1656 return bool[][][] ( bool[][] ( bool[] (a.z, a.x, a.y),
1657 bool[] (a.x, a.y, a.z)),
1658 bool[][] ( bool[] (a.x, a.y, a.z),
1659 bool[] (a.z, a.x, a.y)),
1660 bool[][] ( bool[] (a.y, a.z, a.x),
1661 bool[] (a.y, a.z, a.x)) );
1667 bool[3] x[3][2] = func(in0);
1668 out0 = bvec3(x[0][0][0], x[1][1][1], x[2][1][0]);
1676 desc "Testing arrays of arrays as function return values with implicit array size"
1679 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
1680 output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ];
1685 precision mediump float;
1688 vec3[2][3] func(vec3 p)
1690 vec3[2][3] a = vec3[2][3]( vec3[3] ( vec3(p.x, p.y, -p.z),
1691 vec3(p.y, -p.z, p.x),
1692 vec3(-p.z, p.x, p.y)),
1693 vec3[3] ( vec3(p.y, -p.z, p.x),
1694 vec3(p.x, p.y, -p.z),
1695 vec3(-p.z, p.x, p.y)) );
1697 return vec3[][] ( vec3[] (a[0][1], a[0][2], a[0][0]),
1698 vec3[] (a[1][1], a[1][2], a[1][0]));
1705 vec3[2][3] x = func(in0);
1706 out0 = vec3(x[0][0].x, x[1][1].y, x[0][2].z);
1714 desc "Testing arrays of arrays as function return values with implicit array size"
1717 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
1718 output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ];
1723 precision mediump float;
1732 Test[3][1][3] func(vec3 p)
1734 Test a = Test(p.z, vec3(p.x, p.y, p.z));
1735 Test b = Test(p.y, vec3(-p.z, -p.x, -p.y));
1736 Test c = Test(p.x, vec3(-p.y, p.z, -p.x));
1738 return Test[][][] ( Test[][] (Test[] (b, b, b)),
1739 Test[][] (Test[] (a, a, a)),
1740 Test[][] (Test[] (c, c, c)) );
1746 Test[3][1][3] x = func(in0);
1747 out0 = vec3(x[0][0][0].v.z, x[2][0][2].v.y, x[1][0][1].v.x);
1755 desc "Testing arrays of arrays as function return values with implicit array size"
1758 input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ];
1759 output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ];
1764 precision mediump int;
1765 precision mediump float;
1768 ivec3[3][3] func(ivec3 p)
1770 return ivec3[][] ( ivec3[] ( ivec3(p.x, p.y, -p.z),
1771 ivec3(p.x, p.y, -p.z),
1772 ivec3(p.x, p.y, -p.z)),
1774 ivec3[] ( ivec3(p.y, -p.z, p.x),
1775 ivec3(p.y, -p.z, p.x),
1776 ivec3(p.y, -p.z, p.x)),
1778 ivec3[] ( ivec3(-p.z, p.x, p.y),
1779 ivec3(-p.z, p.x, p.y),
1780 ivec3(-p.z, p.x, p.y)) );
1786 ivec3[3][3] x = func(in0);
1787 out0 = ivec3(x[1][0].x, x[2][0].y, x[0][2].z);
1795 desc "Testing arrays of arrays as function return values with implicit array size"
1798 input bvec4 in0 = [ bvec4(true, false, false, true) ];
1799 output bvec4 out0 = [ bvec4(true, true, false, true) ];
1804 precision mediump int;
1805 precision mediump float;
1808 bvec4[4][2] func(bvec4 p)
1810 bvec4[4] x = bvec4[4]( bvec4(p.x, p.y, p.z, p.w),
1811 bvec4(p.w, p.y, p.z, p.x),
1812 bvec4(p.z, p.w, p.x, p.y),
1813 bvec4(p.y, p.x, p.z, p.w) );
1815 return bvec4[][] ( bvec4[] (bvec4(x[0]),
1818 bvec4[] (bvec4(x[2]),
1821 bvec4[] (bvec4(x[1]),
1824 bvec4[] (bvec4(x[3]),
1831 bvec4[4][2] x = func(in0);
1832 out0 = bvec4(x[0][1].x, x[1][0].y, x[2][0].z, x[3][1].w);
1840 desc "Testing arrays of arrays as function return values with implicit array size"
1843 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
1844 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
1849 precision mediump float;
1852 mat3[3][2] func(vec3 p)
1854 return mat3[][] ( mat3[] (mat3( p.x, p.y, p.z,
1857 mat3( p.z, p.x, -p.y,
1861 mat3[] (mat3( -p.z, -p.z, p.z,
1864 mat3( p.x, p.y, p.z,
1868 mat3[] (mat3( p.z, p.x, -p.y,
1871 mat3( -p.z, -p.z, p.z,
1873 -p.x, -p.x, p.x)) );
1881 mat3 a[3][2] = func(in0);
1887 float ret0 = a0[2][0];
1888 float ret1 = a1[0][2];
1889 float ret2 = a2[1][2];
1891 out0 = vec3(ret0, ret1, ret2);
1899 desc "Testing arrays of arrays as function return values with implicit array size"
1902 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
1903 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
1908 precision mediump int;
1909 precision mediump float;
1912 mat3[3][3][3] func(ivec3 p)
1914 mat3 a = mat3( p.x, p.y, p.z,
1917 mat3 b = mat3( p.z, p.x, -p.y,
1920 mat3 c = mat3( -p.z, -p.z, p.z,
1924 return mat3[][][] ( mat3[][] ( mat3[] (a, a, a),
1928 mat3[][] ( mat3[] (b, b, b),
1932 mat3[][] ( mat3[] (c, c, c),
1934 mat3[] (b, b, b)) );
1941 mat3 x[3][3][3] = func(in0);
1943 mat3 x0 = x[0][0][0];
1944 mat3 x1 = x[1][0][0];
1945 mat3 x2 = x[2][0][0];
1947 float ret0 = x0[2][0];
1948 float ret1 = x1[0][2];
1949 float ret2 = x2[1][2];
1951 out0 = ivec3(ret0, ret1, ret2);
1959 desc "Testing arrays of arrays as function return values with implicit array size"
1962 input bvec3 in0 = [ bvec3(true, false, true) ];
1963 output bvec3 out0 = [ bvec3(true, false, false) ];
1968 precision mediump float;
1971 mat3[3][4] func(bvec3 p)
1973 mat3 a = mat3( p.x, p.y, p.z,
1977 mat3 b = mat3( p.z, p.x, p.y,
1981 mat3 c = mat3( p.z, p.z, p.z,
1985 return mat3[][] ( mat3[] (a, b, c, a),
1986 mat3[] (b, c, a, b),
1987 mat3[] (c, a, b, c) );
1994 mat3[4] x[3] = func(in0);
2000 float ret0 = x0[2][0];
2001 float ret1 = x1[0][2];
2002 float ret2 = x2[1][2];
2004 out0 = bvec3(ret0, ret1, ret2);
2014 group parameter "Array of arrays as a function parameter"
2017 group in "Array of arrays as an in-function parameter"
2021 desc "Testing array of arrays as an in-function parameter"
2024 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
2025 output vec3 out0 = [ vec3(2.0, -0.5, 1.0) | vec3(2.0, -7.4, -1.0) | vec3(-2.0, -3.0, 1.6) ];
2030 precision mediump float;
2033 vec3 func(in float[3][3] x)
2035 return vec3(x[0][0], x[1][1], x[2][2]);
2041 float[3][3] x = float[3][3] ( float[3] (in0.z, 0.0, 0.0),
2042 float[3] (0.0, -in0.x, 0.0),
2043 float[3] (0.0, 0.0, in0.y) );
2053 desc "Testing array of arrays as an in-function parameter"
2056 input ivec2 in0 = [ ivec2(4, 1) | ivec2(7, -1) | ivec2(3, 1) ];
2057 output ivec2 out0 = [ ivec2(1, -4) | ivec2(-1, -7) | ivec2(1, -3) ];
2062 precision mediump int;
2063 precision mediump float;
2066 ivec2 func(in int[2][2][2] x)
2068 return ivec2(x[0][0][0], x[1][1][1]);
2074 int[2][2][2] x = int[2][2][2] ( int[2][2] ( int[2] (in0.y, -in0.x),
2076 int[2][2] ( int[2] (0, 0),
2077 int[2] (in0.y, -in0.x)) );
2087 desc "Testing array of arrays as an in-function parameter"
2090 input bvec3 in0 = [ bvec3(false, true, true) ];
2091 output bvec3 out0 = [ bvec3(true, false, true) ];
2096 precision mediump float;
2099 bvec3 func(in bool x[3][2][3])
2101 return bvec3(x[0][0][0], x[1][1][1], x[2][1][0]);
2107 bool[3] x[3][2] = bool[3][2][3] ( bool[2][3] (bool[3] (in0.z, in0.x, in0.y),
2108 bool[3] (in0.x, in0.y, in0.z)),
2109 bool[2][3] (bool[3] (in0.x, in0.y, in0.z),
2110 bool[3] (in0.z, in0.x, in0.y)),
2111 bool[2][3] (bool[3] (in0.y, in0.z, in0.x),
2112 bool[3] (in0.y, in0.z, in0.x)) );
2122 desc "Testing array of arrays as an in-function parameter"
2125 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
2126 output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ];
2131 precision mediump float;
2134 vec3 func(in vec3[3] x[2])
2136 return vec3(x[0][0].x, x[1][1].y, x[0][2].z);
2142 vec3[2][3] x = vec3[2][3]( vec3[3] ( vec3(in0.x, in0.y, -in0.z),
2143 vec3(in0.y, -in0.z, in0.x),
2144 vec3(-in0.z, in0.x, in0.y)),
2145 vec3[3] ( vec3(in0.y, -in0.z, in0.x),
2146 vec3(in0.x, in0.y, -in0.z),
2147 vec3(-in0.z, in0.x, in0.y)) );
2149 x = vec3[2][3] (vec3[3] (x[0][1], x[0][2], x[0][0]),
2150 vec3[3] (x[1][1], x[1][2], x[1][0]) );
2160 desc "Testing array of arrays as an in-function parameter"
2163 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
2164 output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ];
2169 precision mediump float;
2178 vec3 func(in Test[3] x[3][1])
2180 return vec3(x[0][0][0].v.z, x[2][0][2].v.y, x[1][0][1].v.x);
2186 Test a = Test(in0.z, vec3(in0.x, in0.y, in0.z));
2187 Test b = Test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
2188 Test c = Test(in0.x, vec3(-in0.y, in0.z, -in0.x));
2190 Test x[3][1][3] = Test[3][1][3] ( Test[1][3] (Test[3] (b, b, b)),
2191 Test[1][3] (Test[3] (a, a, a)),
2192 Test[1][3] (Test[3] (c, c, c)) );
2202 desc "Testing array of arrays as an in-function parameter"
2205 input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ];
2206 output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ];
2211 precision mediump int;
2212 precision mediump float;
2215 ivec3 func(in ivec3 x[3][3])
2217 return ivec3(x[1][0].x, x[2][0].y, x[0][2].z);
2223 ivec3[3][3] x = ivec3[3][3] ( ivec3[3] ( ivec3(in0.x, in0.y, -in0.z),
2224 ivec3(in0.x, in0.y, -in0.z),
2225 ivec3(in0.x, in0.y, -in0.z)),
2227 ivec3[3] ( ivec3(in0.y, -in0.z, in0.x),
2228 ivec3(in0.y, -in0.z, in0.x),
2229 ivec3(in0.y, -in0.z, in0.x)),
2231 ivec3[3] ( ivec3(-in0.z, in0.x, in0.y),
2232 ivec3(-in0.z, in0.x, in0.y),
2233 ivec3(-in0.z, in0.x, in0.y)) );
2243 desc "Testing array of arrays as an in-function parameter"
2246 input bvec4 in0 = [ bvec4(true, false, false, true) ];
2247 output bvec4 out0 = [ bvec4(true, true, false, true) ];
2252 precision mediump int;
2253 precision mediump float;
2256 bvec4 func(in bvec4[4][2] x)
2258 return bvec4(x[0][1].x, x[1][0].y, x[2][0].z, x[3][1].w);
2264 bvec4[4] a = bvec4[4]( bvec4(in0.x, in0.y, in0.z, in0.w),
2265 bvec4(in0.w, in0.y, in0.z, in0.x),
2266 bvec4(in0.z, in0.w, in0.x, in0.y),
2267 bvec4(in0.y, in0.x, in0.z, in0.w) );
2269 bvec4 x[4][2] = bvec4[4][2] ( bvec4[2] (bvec4(a[0]),
2272 bvec4[2] (bvec4(a[2]),
2275 bvec4[2] (bvec4(a[1]),
2278 bvec4[2] (bvec4(a[3]),
2289 desc "Testing array of arrays as an in-function parameter"
2292 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
2293 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
2298 precision mediump float;
2301 vec3 func(in mat3[2] x[3])
2307 float ret0 = a0[2][0];
2308 float ret1 = a1[0][2];
2309 float ret2 = a2[1][2];
2311 return vec3(ret0, ret1, ret2);
2318 mat3 a = mat3( in0.x, in0.y, in0.z,
2319 in0.x, in0.y, in0.z,
2320 in0.x, in0.y, in0.z);
2322 mat3 b = mat3( in0.z, in0.x, -in0.y,
2323 in0.z, in0.x, -in0.y,
2324 in0.z, in0.x, -in0.y);
2326 mat3 c = mat3 ( -in0.z, -in0.z, in0.z,
2327 -in0.y, -in0.y, in0.y,
2328 -in0.x, -in0.x, in0.x);
2330 mat3[3][2] x = mat3[3][2] ( mat3[2] (a, b),
2342 desc "Testing array of arrays as an in-function parameter"
2345 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
2346 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
2351 precision mediump int;
2352 precision mediump float;
2355 ivec3 func(in mat3[3][3] x[3])
2357 mat3 x0 = x[0][0][0];
2358 mat3 x1 = x[1][0][0];
2359 mat3 x2 = x[2][0][0];
2361 float ret0 = x0[2][0];
2362 float ret1 = x1[0][2];
2363 float ret2 = x2[1][2];
2365 return ivec3(ret0, ret1, ret2);
2372 mat3 a = mat3( in0.x, in0.y, in0.z,
2373 in0.x, in0.y, in0.z,
2374 in0.x, in0.y, in0.z);
2375 mat3 b = mat3( in0.z, in0.x, -in0.y,
2376 in0.z, in0.x, -in0.y,
2377 in0.z, in0.x, -in0.y);
2378 mat3 c = mat3( -in0.z, -in0.z, in0.z,
2379 -in0.y, -in0.y, in0.y,
2380 -in0.x, -in0.x, in0.x);
2382 mat3 x[3][3][3] = mat3[3][3][3] ( mat3[3][3] (mat3[3] (a, a, a),
2386 mat3[3][3] (mat3[3] (b, b, b),
2390 mat3[3][3] (mat3[3] (c, c, c),
2392 mat3[3] (b, b, b)) );
2402 desc "Testing array of arrays as an in-function parameter"
2405 input bvec3 in0 = [ bvec3(true, false, true) ];
2406 output bvec3 out0 = [ bvec3(true, false, false) ];
2411 precision mediump float;
2414 bvec3 func(in mat3[4] x[3])
2420 float ret0 = x0[2][0];
2421 float ret1 = x1[0][2];
2422 float ret2 = x2[1][2];
2424 return bvec3(ret0, ret1, ret2);
2431 mat3 a = mat3( in0.x, in0.y, in0.z,
2432 in0.x, in0.y, in0.z,
2433 in0.x, in0.y, in0.z);
2435 mat3 b = mat3( in0.z, in0.x, in0.y,
2436 in0.z, in0.x, in0.y,
2437 in0.z, in0.x, in0.y);
2439 mat3 c = mat3( in0.z, in0.z, in0.z,
2440 in0.y, in0.y, in0.y,
2441 in0.x, in0.x, in0.x);
2443 mat3 x[3][4] = mat3[3][4] ( mat3[4] (a, b, c, a),
2444 mat3[4] (b, c, a, b),
2445 mat3[4] (c, a, b, c) );
2457 group out "Array of arrays as an out-function paramter"
2461 desc "Testing array of arrays as an out-function parameter"
2464 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
2465 output vec3 out0 = [ vec3(2.0, -0.5, 1.0) | vec3(2.0, -7.4, -1.0) | vec3(-2.0, -3.0, 1.6) ];
2470 precision mediump float;
2473 void func(out float[3][3] x, in vec3 p)
2475 x = float[3][3] ( float[3] (p.z, 0.0, 0.0),
2476 float[3] (0.0, -p.x, 0.0),
2477 float[3] (0.0, 0.0, p.y) );
2485 out0 = vec3(x[0][0], x[1][1], x[2][2]);
2493 desc "Testing array of arrays as an out-function parameter"
2496 input ivec2 in0 = [ ivec2(4, 1) | ivec2(7, -1) | ivec2(3, 1) ];
2497 output ivec2 out0 = [ ivec2(1, -4) | ivec2(-1, -7) | ivec2(1, -3) ];
2502 precision mediump int;
2503 precision mediump float;
2506 void func(out int[2][2][2] x, in ivec2 p)
2508 x = int[2][2][2] ( int[2][2] ( int[2] (p.y, -p.x),
2510 int[2][2] ( int[2] (0, 0),
2511 int[2] (p.y, -p.x)) );
2519 out0 = ivec2(x[0][0][0], x[1][1][1]);
2527 desc "Testing array of arrays as an out-function parameter"
2530 input bvec3 in0 = [ bvec3(false, true, true) ];
2531 output bvec3 out0 = [ bvec3(true, false, true) ];
2536 precision mediump float;
2539 void func(out bool x[3][2][3], in bvec3 p)
2541 x = bool[3][2][3] ( bool[2][3] (bool[3] (p.z, p.x, p.y),
2542 bool[3] (p.x, p.y, p.z)),
2543 bool[2][3] (bool[3] (p.x, p.y, p.z),
2544 bool[3] (p.z, p.x, p.y)),
2545 bool[2][3] (bool[3] (p.y, p.z, p.x),
2546 bool[3] (p.y, p.z, p.x)) );
2554 out0 = bvec3(x[0][0][0], x[1][1][1], x[2][1][0]);
2562 desc "Testing array of arrays as an out-function parameter"
2565 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
2566 output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ];
2571 precision mediump float;
2574 void func(out vec3[3] x[2], in vec3 p)
2576 x = vec3[2][3]( vec3[3] (vec3(p.x, p.y, -p.z),
2577 vec3(p.y, -p.z, p.x),
2578 vec3(-p.z, p.x, p.y)),
2579 vec3[3] (vec3(p.y, -p.z, p.x),
2580 vec3(p.x, p.y, -p.z),
2581 vec3(-p.z, p.x, p.y)) );
2583 x = vec3[2][3] (vec3[3] (x[0][1], x[0][2], x[0][0]),
2584 vec3[3] (x[1][1], x[1][2], x[1][0]) );
2592 out0 = vec3(x[0][0].x, x[1][1].y, x[0][2].z);
2600 desc "Testing array of arrays as an out-function parameter"
2603 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
2604 output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ];
2609 precision mediump float;
2618 void func(out Test[3] x[3][1], in vec3 p)
2620 Test a = Test(p.z, vec3(p.x, p.y, p.z));
2621 Test b = Test(p.y, vec3(-p.z, -p.x, -p.y));
2622 Test c = Test(p.x, vec3(-p.y, p.z, -p.x));
2624 x = Test[3][1][3] ( Test[1][3] (Test[3] (b, b, b)),
2625 Test[1][3] (Test[3] (a, a, a)),
2626 Test[1][3] (Test[3] (c, c, c)) );
2634 out0 = vec3(x[0][0][0].v.z, x[2][0][2].v.y, x[1][0][1].v.x);
2642 desc "Testing array of arrays as an out-function parameter"
2645 input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ];
2646 output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ];
2651 precision mediump int;
2652 precision mediump float;
2655 void func(out ivec3 x[3][3], in ivec3 p)
2657 x = ivec3[3][3] (ivec3[3] ( ivec3(p.x, p.y, -p.z),
2658 ivec3(p.x, p.y, -p.z),
2659 ivec3(p.x, p.y, -p.z)),
2661 ivec3[3] ( ivec3(p.y, -p.z, p.x),
2662 ivec3(p.y, -p.z, p.x),
2663 ivec3(p.y, -p.z, p.x)),
2665 ivec3[3] ( ivec3(-p.z, p.x, p.y),
2666 ivec3(-p.z, p.x, p.y),
2667 ivec3(-p.z, p.x, p.y)) );
2676 out0 = ivec3(x[1][0].x, x[2][0].y, x[0][2].z);
2684 desc "Testing array of arrays as an out-function parameter"
2687 input bvec4 in0 = [ bvec4(true, false, false, true) ];
2688 output bvec4 out0 = [ bvec4(true, true, false, true) ];
2693 precision mediump int;
2694 precision mediump float;
2697 void func(out bvec4[4][2] x, in bvec4 p)
2699 bvec4[4] a = bvec4[4]( bvec4(p.x, p.y, p.z, p.w),
2700 bvec4(p.w, p.y, p.z, p.x),
2701 bvec4(p.z, p.w, p.x, p.y),
2702 bvec4(p.y, p.x, p.z, p.w) );
2704 x = bvec4[4][2] ( bvec4[2] (bvec4(a[0]),
2707 bvec4[2] (bvec4(a[2]),
2710 bvec4[2] (bvec4(a[1]),
2713 bvec4[2] (bvec4(a[3]),
2722 out0 = bvec4(x[0][1].x, x[1][0].y, x[2][0].z, x[3][1].w);
2730 desc "Testing array of arrays as an out-function parameter"
2733 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
2734 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
2739 precision mediump float;
2742 void func(out mat3[2] x[3], in vec3 p)
2744 mat3 a = mat3( p.x, p.y, p.z,
2748 mat3 b = mat3( p.z, p.x, -p.y,
2752 mat3 c = mat3 ( -p.z, -p.z, p.z,
2756 x = mat3[3][2] (mat3[2] (a, b),
2772 float ret0 = a0[2][0];
2773 float ret1 = a1[0][2];
2774 float ret2 = a2[1][2];
2776 out0 = vec3(ret0, ret1, ret2);
2785 desc "Testing array of arrays as an out-function parameter"
2788 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
2789 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
2794 precision mediump int;
2795 precision mediump float;
2798 void func(out mat3[3] x[3][3], in ivec3 p)
2800 mat3 a = mat3( p.x, p.y, p.z,
2803 mat3 b = mat3( p.z, p.x, -p.y,
2806 mat3 c = mat3( -p.z, -p.z, p.z,
2810 x = mat3[3][3][3] ( mat3[3][3] (mat3[3] (a, a, a),
2814 mat3[3][3] (mat3[3] (b, b, b),
2818 mat3[3][3] (mat3[3] (c, c, c),
2820 mat3[3] (b, b, b)) );
2830 mat3 x0 = x[0][0][0];
2831 mat3 x1 = x[1][0][0];
2832 mat3 x2 = x[2][0][0];
2834 float ret0 = x0[2][0];
2835 float ret1 = x1[0][2];
2836 float ret2 = x2[1][2];
2838 out0 = ivec3(ret0, ret1, ret2);
2847 desc "Testing array of arrays as an out-function parameter"
2850 input bvec3 in0 = [ bvec3(true, false, true) ];
2851 output bvec3 out0 = [ bvec3(true, false, false) ];
2856 precision mediump float;
2859 void func(out mat3[4] x[3], in bvec3 p)
2861 mat3 a = mat3( p.x, p.y, p.z,
2865 mat3 b = mat3( p.z, p.x, p.y,
2869 mat3 c = mat3( p.z, p.z, p.z,
2873 x = mat3[3][4] (mat3[4] (a, b, c, a),
2874 mat3[4] (b, c, a, b),
2875 mat3[4] (c, a, b, c) );
2889 float ret0 = x0[2][0];
2890 float ret1 = x1[0][2];
2891 float ret2 = x2[1][2];
2893 out0 = bvec3(ret0, ret1, ret2);
2902 group unnamed "Array of arrays as unnamed parameter of a function prototype"
2906 desc "Testing array of arrays as unnamed parameter of a function prototype"
2909 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
2910 output vec3 out0 = [ vec3(2.0, -0.5, 1.0) | vec3(2.0, -7.4, -1.0) | vec3(-2.0, -3.0, 1.6) ];
2915 precision mediump float;
2918 vec3 func(in float[3][3]);
2923 float[3][3] x = float[3][3] ( float[3] (in0.z, 0.0, 0.0),
2924 float[3] (0.0, -in0.x, 0.0),
2925 float[3] (0.0, 0.0, in0.y) );
2930 vec3 func(in float[3][3] x)
2932 return vec3(x[0][0], x[1][1], x[2][2]);
2939 desc "Testing array of arrays as unnamed parameter of a function prototype"
2942 input ivec2 in0 = [ ivec2(4, 1) | ivec2(7, -1) | ivec2(3, 1) ];
2943 output ivec2 out0 = [ ivec2(1, -4) | ivec2(-1, -7) | ivec2(1, -3) ];
2948 precision mediump int;
2949 precision mediump float;
2952 ivec2 func(in int[2][2][2]);
2957 int[2][2][2] x = int[2][2][2] ( int[2][2] ( int[2] (in0.y, -in0.x),
2959 int[2][2] ( int[2] (0, 0),
2960 int[2] (in0.y, -in0.x)) );
2965 ivec2 func(in int[2][2][2] x)
2967 return ivec2(x[0][0][0], x[1][1][1]);
2975 desc "Testing array of arrays as unnamed parameter of a function prototype"
2978 input bvec3 in0 = [ bvec3(false, true, true) ];
2979 output bvec3 out0 = [ bvec3(true, false, true) ];
2984 precision mediump float;
2987 bvec3 func(in bool[3][2][3]);
2992 bool[3] x[3][2] = bool[3][2][3] ( bool[2][3] (bool[3] (in0.z, in0.x, in0.y),
2993 bool[3] (in0.x, in0.y, in0.z)),
2994 bool[2][3] (bool[3] (in0.x, in0.y, in0.z),
2995 bool[3] (in0.z, in0.x, in0.y)),
2996 bool[2][3] (bool[3] (in0.y, in0.z, in0.x),
2997 bool[3] (in0.y, in0.z, in0.x)) );
3002 bvec3 func(in bool x[3][2][3])
3004 return bvec3(x[0][0][0], x[1][1][1], x[2][1][0]);
3011 desc "Testing array of arrays as unnamed parameter of a function prototype"
3014 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
3015 output vec3 out0 = [ vec3(1.0, 0.5, -2.0) | vec3(11.2, -0.5, 1.0) ];
3020 precision mediump float;
3023 vec3 func(in vec3[2][3]);
3028 vec3[2][3] x = vec3[2][3]( vec3[3] ( vec3(in0.x, in0.y, -in0.z),
3029 vec3(in0.y, -in0.z, in0.x),
3030 vec3(-in0.z, in0.x, in0.y)),
3031 vec3[3] ( vec3(in0.y, -in0.z, in0.x),
3032 vec3(in0.x, in0.y, -in0.z),
3033 vec3(-in0.z, in0.x, in0.y)) );
3035 x = vec3[2][3] (vec3[3] (x[0][1], x[0][2], x[0][0]),
3036 vec3[3] (x[1][1], x[1][2], x[1][0]) );
3041 vec3 func(in vec3[3] x[2])
3043 return vec3(x[0][0].x, x[1][1].y, x[0][2].z);
3050 desc "Testing array of arrays as unnamed parameter of a function prototype"
3053 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
3054 output vec3 out0 = [ vec3(-1.0, 2.0, 0.5) ];
3059 precision mediump float;
3068 vec3 func(in Test[3] x[3][1])
3070 return vec3(x[0][0][0].v.z, x[2][0][2].v.y, x[1][0][1].v.x);
3076 Test a = Test(in0.z, vec3(in0.x, in0.y, in0.z));
3077 Test b = Test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
3078 Test c = Test(in0.x, vec3(-in0.y, in0.z, -in0.x));
3080 Test x[3][1][3] = Test[3][1][3] ( Test[1][3] (Test[3] (b, b, b)),
3081 Test[1][3] (Test[3] (a, a, a)),
3082 Test[1][3] (Test[3] (c, c, c)) );
3092 desc "Testing array of arrays as unnamed parameter of a function prototype"
3095 input ivec3 in0 = [ ivec3(5, 1, 2) | ivec3(-5, 11, -1) ];
3096 output ivec3 out0 = [ ivec3(1, 5, -2) | ivec3(11, -5, 1) ];
3101 precision mediump int;
3102 precision mediump float;
3105 ivec3 func(in ivec3[3][3]);
3110 ivec3[3][3] x = ivec3[3][3] ( ivec3[3] ( ivec3(in0.x, in0.y, -in0.z),
3111 ivec3(in0.x, in0.y, -in0.z),
3112 ivec3(in0.x, in0.y, -in0.z)),
3114 ivec3[3] ( ivec3(in0.y, -in0.z, in0.x),
3115 ivec3(in0.y, -in0.z, in0.x),
3116 ivec3(in0.y, -in0.z, in0.x)),
3118 ivec3[3] ( ivec3(-in0.z, in0.x, in0.y),
3119 ivec3(-in0.z, in0.x, in0.y),
3120 ivec3(-in0.z, in0.x, in0.y)) );
3125 ivec3 func(in ivec3 x[3][3])
3127 return ivec3(x[1][0].x, x[2][0].y, x[0][2].z);
3135 desc "Testing array of arrays as unnamed parameter of a function prototype"
3138 input bvec4 in0 = [ bvec4(true, false, false, true) ];
3139 output bvec4 out0 = [ bvec4(true, true, false, true) ];
3144 precision mediump int;
3145 precision mediump float;
3148 bvec4 func(in bvec4[4][2]);
3153 bvec4[4] a = bvec4[4]( bvec4(in0.x, in0.y, in0.z, in0.w),
3154 bvec4(in0.w, in0.y, in0.z, in0.x),
3155 bvec4(in0.z, in0.w, in0.x, in0.y),
3156 bvec4(in0.y, in0.x, in0.z, in0.w) );
3158 bvec4 x[4][2] = bvec4[4][2] ( bvec4[2] (bvec4(a[0]),
3161 bvec4[2] (bvec4(a[2]),
3164 bvec4[2] (bvec4(a[1]),
3167 bvec4[2] (bvec4(a[3]),
3174 bvec4 func(in bvec4[4][2] x)
3176 return bvec4(x[0][1].x, x[1][0].y, x[2][0].z, x[3][1].w);
3183 desc "Testing array of arrays as unnamed parameter of a function prototype"
3186 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
3187 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
3192 precision mediump float;
3195 vec3 func(in mat3[3][2]);
3201 mat3 a = mat3( in0.x, in0.y, in0.z,
3202 in0.x, in0.y, in0.z,
3203 in0.x, in0.y, in0.z);
3205 mat3 b = mat3( in0.z, in0.x, -in0.y,
3206 in0.z, in0.x, -in0.y,
3207 in0.z, in0.x, -in0.y);
3209 mat3 c = mat3 ( -in0.z, -in0.z, in0.z,
3210 -in0.y, -in0.y, in0.y,
3211 -in0.x, -in0.x, in0.x);
3213 mat3[3][2] x = mat3[3][2] ( mat3[2] (a, b),
3221 vec3 func(in mat3[2] x[3])
3227 float ret0 = a0[2][0];
3228 float ret1 = a1[0][2];
3229 float ret2 = a2[1][2];
3231 return vec3(ret0, ret1, ret2);
3238 desc "Testing array of arrays as unnamed parameter of a function prototype"
3241 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
3242 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
3247 precision mediump int;
3248 precision mediump float;
3251 ivec3 func(in mat3[3][3][3]);
3257 mat3 a = mat3( in0.x, in0.y, in0.z,
3258 in0.x, in0.y, in0.z,
3259 in0.x, in0.y, in0.z);
3260 mat3 b = mat3( in0.z, in0.x, -in0.y,
3261 in0.z, in0.x, -in0.y,
3262 in0.z, in0.x, -in0.y);
3263 mat3 c = mat3( -in0.z, -in0.z, in0.z,
3264 -in0.y, -in0.y, in0.y,
3265 -in0.x, -in0.x, in0.x);
3267 mat3 x[3][3][3] = mat3[3][3][3] (mat3[3][3] (mat3[3] (a, a, a),
3271 mat3[3][3] (mat3[3] (b, b, b),
3275 mat3[3][3] (mat3[3] (c, c, c),
3277 mat3[3] (b, b, b)) );
3283 ivec3 func(in mat3[3][3] x[3])
3285 mat3 x0 = x[0][0][0];
3286 mat3 x1 = x[1][0][0];
3287 mat3 x2 = x[2][0][0];
3289 float ret0 = x0[2][0];
3290 float ret1 = x1[0][2];
3291 float ret2 = x2[1][2];
3293 return ivec3(ret0, ret1, ret2);
3300 desc "Testing array of arrays as unnamed parameter of a function prototype"
3303 input bvec3 in0 = [ bvec3(true, false, true) ];
3304 output bvec3 out0 = [ bvec3(true, false, false) ];
3309 precision mediump float;
3312 bvec3 func(in mat3[3][4]);
3318 mat3 a = mat3( in0.x, in0.y, in0.z,
3319 in0.x, in0.y, in0.z,
3320 in0.x, in0.y, in0.z);
3322 mat3 b = mat3( in0.z, in0.x, in0.y,
3323 in0.z, in0.x, in0.y,
3324 in0.z, in0.x, in0.y);
3326 mat3 c = mat3( in0.z, in0.z, in0.z,
3327 in0.y, in0.y, in0.y,
3328 in0.x, in0.x, in0.x);
3330 mat3 x[3][4] = mat3[3][4] ( mat3[4] (a, b, c, a),
3331 mat3[4] (b, c, a, b),
3332 mat3[4] (c, a, b, c) );
3339 bvec3 func(in mat3[4] x[3])
3345 float ret0 = x0[2][0];
3346 float ret1 = x1[0][2];
3347 float ret2 = x2[1][2];
3349 return bvec3(ret0, ret1, ret2);
3354 end # unnamed_parameter
3358 group implicit_size "Declaring arrays of arrays with implicit size"
3362 desc "Testing declaring arrays of arrays with implicit size"
3365 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
3366 output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
3371 precision mediump float;
3377 float x[][] = float[][] ( float[] (in0.z, in0.x, in0.y),
3378 float[] (in0.z, in0.x, in0.y),
3379 float[] (in0.z, in0.x, in0.y) );
3381 out0 = vec3(x[0][0], x[1][1], x[2][2]);
3389 desc "Testing declaring arrays of arrays with implicit size"
3392 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
3393 output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
3398 precision mediump int;
3399 precision mediump float;
3405 int[][] x = int[][] ( int[] (in0.z, in0.x, in0.y),
3406 int[] (in0.z, in0.x, in0.y) );;
3408 out0 = ivec3(x[0][0], x[1][1], x[0][2]);
3416 desc "Testing declaring arrays of arrays with implicit size"
3419 input bvec3 in0 = [ bvec3(false, true, true) ];
3420 output bvec3 out0 = [ bvec3(true, false, true) ];
3425 precision mediump float;
3431 bool[][] x[] = bool[][][] ( bool[][] ( bool[](in0.z, in0.z, in0.z),
3432 bool[](in0.z, in0.z, in0.z),
3433 bool[](in0.z, in0.z, in0.z)),
3435 bool[][] ( bool[](in0.x, in0.x, in0.x),
3436 bool[](in0.x, in0.x, in0.x),
3437 bool[](in0.x, in0.x, in0.x)),
3439 bool[][] ( bool[](in0.y, in0.y, in0.y),
3440 bool[](in0.y, in0.y, in0.y),
3441 bool[](in0.y, in0.y, in0.y)) );
3443 out0 = bvec3(x[0][0][0], x[1][1][1], x[2][2][2]);
3451 desc "Testing declaring arrays of arrays with implicit size"
3454 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
3455 output vec3 out0 = [ vec3(-1.0, -0.5, 2.0) ];
3460 precision mediump float;
3473 Test a = Test(in0.z, vec3(in0.x, in0.y, in0.z));
3474 Test b = Test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
3475 Test c = Test(in0.x, vec3(-in0.y, in0.z, -in0.x));
3477 Test[] x[][] = Test[][][] ( Test[][] ( Test[] (c, c, c, c),
3478 Test[] (b, b, b, b),
3479 Test[] (a, a, a, a),
3480 Test[] (c, c, c, c),
3481 Test[] (b, b, b, b) ),
3483 Test[][] ( Test[] (a, a, a, a),
3484 Test[] (b, b, b, b),
3485 Test[] (c, c, c, c),
3486 Test[] (a, a, a, a),
3487 Test[] (b, b, b, b) ),
3489 Test[][] ( Test[] (b, b, b, b),
3490 Test[] (c, c, c, c),
3491 Test[] (a, a, a, a),
3492 Test[] (b, b, b, b),
3493 Test[] (c, c, c, c) ),
3495 Test[][] ( Test[] (c, c, c, c),
3496 Test[] (b, b, b, b),
3497 Test[] (a, a, a, a),
3498 Test[] (c, c, c, c),
3499 Test[] (b, b, b, b) ),
3501 Test[][] ( Test[] (a, a, a, a),
3502 Test[] (b, b, b, b),
3503 Test[] (c, c, c, c),
3504 Test[] (a, a, a, a),
3505 Test[] (b, b, b, b) ) );
3507 out0 = vec3(x[0][0][0].v.x, x[1][1][1].v.y, x[4][3][3].v.z);
3515 desc "Testing declaring arrays of arrays with implicit size"
3518 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
3519 output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(-0.5, 1.0, 11.2) ];
3524 precision mediump float;
3530 vec3 x[][] = vec3[][] ( vec3[] (vec3(in0.x, in0.y, -in0.z) ,
3531 vec3(in0.y, -in0.z, in0.x) ,
3532 vec3(-in0.z, in0.x, in0.y)) );
3534 out0 = vec3(x[0][0].x, x[0][1].y, x[0][2].z);
3542 desc "Testing declaring arrays of arrays with implicit size"
3545 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(5, 11, -1) ];
3546 output ivec3 out0 = [ ivec3(0, -2, 1) | ivec3(5, 1, 11) ];
3551 precision mediump int;
3552 precision mediump float;
3558 ivec3[][][] x = ivec3[][][] ( ivec3[][] ( ivec3[] ( ivec3(in0.x, in0.y, -in0.z),
3559 ivec3(0.0, 0.0, 0.0),
3560 ivec3(0.0, 0.0, 0.0)) ),
3562 ivec3[][] ( ivec3[] ( ivec3(0.0, 0.0, 0.0),
3563 ivec3(in0.y, -in0.z, in0.x),
3564 ivec3(0.0, 0.0, 0.0)) ),
3566 ivec3[][] ( ivec3[] ( ivec3(0.0, 0.0, 0.0),
3567 ivec3(0.0, 0.0, 0.0),
3568 ivec3(-in0.z, in0.x, in0.y)) ) );
3570 out0 = ivec3(x[0][0][0].x, x[1][0][1].y, x[2][0][2].z);
3578 desc "Testing declaring arrays of arrays with implicit size"
3581 input bvec3 in0 = [ bvec3(true, false, true) ];
3582 output bvec3 out0 = [ bvec3(true, true, false) ];
3587 precision mediump float;
3593 bvec3[][] x = bvec3[][] ( bvec3[] ( bvec3(in0.x, in0.y, in0.z)),
3594 bvec3[] ( bvec3(in0.y, in0.z, in0.x)),
3595 bvec3[] ( bvec3(in0.z, in0.x, in0.y)) );
3597 out0 = bvec3(x[0][0].x, x[1][0].y, x[2][0].z);
3605 desc "Testing declaring arrays of arrays with implicit size"
3608 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
3609 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
3614 precision mediump float;
3620 mat3[][] a = mat3[][] ( mat3[] ( mat3( in0.x, in0.y, in0.z,
3621 in0.x, in0.y, in0.z,
3622 in0.x, in0.y, in0.z),
3623 mat3( in0.z, in0.x, -in0.y,
3624 in0.z, in0.x, -in0.y,
3625 in0.z, in0.x, -in0.y)),
3627 mat3[] ( mat3( -in0.z, -in0.z, in0.z,
3628 -in0.y, -in0.y, in0.y,
3629 -in0.x, -in0.x, in0.x),
3630 mat3( in0.x, in0.y, in0.z,
3631 in0.x, in0.y, in0.z,
3632 in0.x, in0.y, in0.z)),
3634 mat3[] ( mat3( in0.z, in0.x, -in0.y,
3635 in0.z, in0.x, -in0.y,
3636 in0.z, in0.x, -in0.y),
3637 mat3( -in0.z, -in0.z, in0.z,
3638 -in0.y, -in0.y, in0.y,
3639 -in0.x, -in0.x, in0.x)) );
3645 float ret0 = a0[2][0];
3646 float ret1 = a1[0][2];
3647 float ret2 = a2[1][2];
3649 out0 = vec3(ret0, ret1, ret2);
3657 desc "Testing declaring arrays of arrays with implicit size"
3660 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
3661 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
3666 precision mediump int;
3667 precision mediump float;
3674 mat3 a = mat3( in0.x, in0.y, in0.z,
3675 in0.x, in0.y, in0.z,
3676 in0.x, in0.y, in0.z);
3677 mat3 b = mat3( in0.z, in0.x, -in0.y,
3678 in0.z, in0.x, -in0.y,
3679 in0.z, in0.x, -in0.y);
3680 mat3 c = mat3( -in0.z, -in0.z, in0.z,
3681 -in0.y, -in0.y, in0.y,
3682 -in0.x, -in0.x, in0.x);
3684 mat3[][][] x = mat3[][][] ( mat3[][] ( mat3[] (a, a, a),
3688 mat3[][] ( mat3[] (b, b, b),
3692 mat3[][] ( mat3[] (c, c, c),
3694 mat3[] (b, b, b)) );
3696 mat3 x0 = x[0][0][0];
3697 mat3 x1 = x[1][0][0];
3698 mat3 x2 = x[2][0][0];
3700 float ret0 = x0[2][0];
3701 float ret1 = x1[0][2];
3702 float ret2 = x2[1][2];
3704 out0 = ivec3(ret0, ret1, ret2);
3712 desc "Testing declaring arrays of arrays with implicit size"
3715 input bvec3 in0 = [ bvec3(true, false, true) ];
3716 output bvec3 out0 = [ bvec3(true, false, false) ];
3721 precision mediump float;
3728 mat3 a = mat3( in0.x, in0.y, in0.z,
3729 in0.x, in0.y, in0.z,
3730 in0.x, in0.y, in0.z);
3732 mat3 b = mat3( in0.z, in0.x, in0.y,
3733 in0.z, in0.x, in0.y,
3734 in0.z, in0.x, in0.y);
3736 mat3 c = mat3( in0.z, in0.z, in0.z,
3737 in0.y, in0.y, in0.y,
3738 in0.x, in0.x, in0.x);
3740 mat3[] x[] = mat3[][] ( mat3[] (a, b, c, a),
3741 mat3[] (b, c, a, b),
3742 mat3[] (c, a, b, c) );
3748 float ret0 = x0[2][0];
3749 float ret1 = x1[0][2];
3750 float ret2 = x2[1][2];
3752 out0 = bvec3(ret0, ret1, ret2);
3760 group assignment "Testing assignment of arrays of arrays"
3762 group explicit_to_explicit "Declaring an array of arrays with explicit size and assigning it to another array of arrays with explicit size"
3766 desc "Testing assignment of arrays of arrays with explicit size"
3769 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
3770 output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
3775 precision mediump float;
3781 float x[3][3] = float[3][3] ( float[3] (in0.z, in0.x, in0.y),
3782 float[3] (in0.z, in0.x, in0.y),
3783 float[3] (in0.z, in0.x, in0.y) );
3787 out0 = vec3(y[0][0], y[1][1], y[2][2]);
3795 desc "Testing assignment of arrays of arrays with explicit size"
3798 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
3799 output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
3804 precision mediump int;
3805 precision mediump float;
3811 int[2][3] x = int[2][3] ( int[3] (in0.z, in0.x, in0.y),
3812 int[3] (in0.z, in0.x, in0.y) );;
3815 out0 = ivec3(y[0][0], y[1][1], y[0][2]);
3823 desc "Testing assignment of arrays of arrays with explicit size"
3826 input bvec3 in0 = [ bvec3(false, true, true) ];
3827 output bvec3 out0 = [ bvec3(true, false, true) ];
3832 precision mediump float;
3838 bool[3][3] x[3] = bool[3][3][3] (bool[3][3] (bool[3](in0.z, in0.z, in0.z),
3839 bool[3](in0.z, in0.z, in0.z),
3840 bool[3](in0.z, in0.z, in0.z)),
3842 bool[3][3] (bool[3](in0.x, in0.x, in0.x),
3843 bool[3](in0.x, in0.x, in0.x),
3844 bool[3](in0.x, in0.x, in0.x)),
3846 bool[3][3] (bool[3](in0.y, in0.y, in0.y),
3847 bool[3](in0.y, in0.y, in0.y),
3848 bool[3](in0.y, in0.y, in0.y)) );
3850 bool[3] y[3][3] = x;
3852 out0 = bvec3(y[0][0][0], y[1][1][1], y[2][2][2]);
3860 desc "Testing assignment of arrays of arrays with explicit size"
3863 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
3864 output vec3 out0 = [ vec3(-1.0, -0.5, 2.0) ];
3869 precision mediump float;
3882 Test a = Test(in0.z, vec3(in0.x, in0.y, in0.z));
3883 Test b = Test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
3884 Test c = Test(in0.x, vec3(-in0.y, in0.z, -in0.x));
3886 Test[4] x[5][5] = Test[5][5][4] ( Test[5][4] (Test[4] (c, c, c, c),
3887 Test[4] (b, b, b, b),
3888 Test[4] (a, a, a, a),
3889 Test[4] (c, c, c, c),
3890 Test[4] (b, b, b, b) ),
3892 Test[5][4] (Test[4] (a, a, a, a),
3893 Test[4] (b, b, b, b),
3894 Test[4] (c, c, c, c),
3895 Test[4] (a, a, a, a),
3896 Test[4] (b, b, b, b) ),
3898 Test[5][4] (Test[4] (b, b, b, b),
3899 Test[4] (c, c, c, c),
3900 Test[4] (a, a, a, a),
3901 Test[4] (b, b, b, b),
3902 Test[4] (c, c, c, c) ),
3904 Test[5][4] (Test[4] (c, c, c, c),
3905 Test[4] (b, b, b, b),
3906 Test[4] (a, a, a, a),
3907 Test[4] (c, c, c, c),
3908 Test[4] (b, b, b, b) ),
3910 Test[5][4] (Test[4] (a, a, a, a),
3911 Test[4] (b, b, b, b),
3912 Test[4] (c, c, c, c),
3913 Test[4] (a, a, a, a),
3914 Test[4] (b, b, b, b) ) );
3916 Test y[5][5][4] = x;
3918 out0 = vec3(y[0][0][0].v.x, y[1][1][1].v.y, y[4][3][3].v.z);
3926 desc "Testing assignment of arrays of arrays with explicit size"
3929 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
3930 output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(-0.5, 1.0, 11.2) ];
3935 precision mediump float;
3941 vec3 x[1][3] = vec3[1][3] ( vec3[3] (vec3(in0.x, in0.y, -in0.z),
3942 vec3(in0.y, -in0.z, in0.x),
3943 vec3(-in0.z, in0.x, in0.y)) );
3947 out0 = vec3(y[0][0].x, y[0][1].y, y[0][2].z);
3955 desc "Testing assignment of arrays of arrays with explicit size"
3958 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(5, 11, -1) ];
3959 output ivec3 out0 = [ ivec3(0, -2, 1) | ivec3(5, 1, 11) ];
3964 precision mediump int;
3965 precision mediump float;
3971 ivec3[3][1][3] x = ivec3[3][1][3] ( ivec3[1][3] (ivec3[3] ( ivec3(in0.x, in0.y, -in0.z),
3972 ivec3(0.0, 0.0, 0.0),
3973 ivec3(0.0, 0.0, 0.0)) ),
3975 ivec3[1][3] (ivec3[3] ( ivec3(0.0, 0.0, 0.0),
3976 ivec3(in0.y, -in0.z, in0.x),
3977 ivec3(0.0, 0.0, 0.0)) ),
3979 ivec3[1][3] (ivec3[3] ( ivec3(0.0, 0.0, 0.0),
3980 ivec3(0.0, 0.0, 0.0),
3981 ivec3(-in0.z, in0.x, in0.y)) ) );
3983 ivec3[3] y[3][1] = x;
3985 out0 = ivec3(y[0][0][0].x, y[1][0][1].y, y[2][0][2].z);
3993 desc "Testing assignment of arrays of arrays with explicit size"
3996 input bvec3 in0 = [ bvec3(true, false, true) ];
3997 output bvec3 out0 = [ bvec3(true, true, false) ];
4002 precision mediump float;
4008 bvec3[3][1] x = bvec3[3][1] ( bvec3[1] ( bvec3(in0.x, in0.y, in0.z)),
4009 bvec3[1] ( bvec3(in0.y, in0.z, in0.x)),
4010 bvec3[1] ( bvec3(in0.z, in0.x, in0.y)) );
4014 out0 = bvec3(y[0][0].x, y[1][0].y, y[2][0].z);
4022 desc "Testing assignment of arrays of arrays with explicit size"
4025 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
4026 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
4031 precision mediump float;
4037 mat3[3][2] a = mat3[3][2] ( mat3[2] (mat3( in0.x, in0.y, in0.z,
4038 in0.x, in0.y, in0.z,
4039 in0.x, in0.y, in0.z),
4040 mat3( in0.z, in0.x, -in0.y,
4041 in0.z, in0.x, -in0.y,
4042 in0.z, in0.x, -in0.y)),
4044 mat3[2] (mat3( -in0.z, -in0.z, in0.z,
4045 -in0.y, -in0.y, in0.y,
4046 -in0.x, -in0.x, in0.x),
4047 mat3( in0.x, in0.y, in0.z,
4048 in0.x, in0.y, in0.z,
4049 in0.x, in0.y, in0.z)),
4051 mat3[2] (mat3( in0.z, in0.x, -in0.y,
4052 in0.z, in0.x, -in0.y,
4053 in0.z, in0.x, -in0.y),
4054 mat3( -in0.z, -in0.z, in0.z,
4055 -in0.y, -in0.y, in0.y,
4056 -in0.x, -in0.x, in0.x)) );
4064 float ret0 = a0[2][0];
4065 float ret1 = a1[0][2];
4066 float ret2 = a2[1][2];
4068 out0 = vec3(ret0, ret1, ret2);
4076 desc "Testing assignment of arrays of arrays with explicit size"
4079 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
4080 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
4085 precision mediump int;
4086 precision mediump float;
4093 mat3 a = mat3( in0.x, in0.y, in0.z,
4094 in0.x, in0.y, in0.z,
4095 in0.x, in0.y, in0.z);
4096 mat3 b = mat3( in0.z, in0.x, -in0.y,
4097 in0.z, in0.x, -in0.y,
4098 in0.z, in0.x, -in0.y);
4099 mat3 c = mat3( -in0.z, -in0.z, in0.z,
4100 -in0.y, -in0.y, in0.y,
4101 -in0.x, -in0.x, in0.x);
4103 mat3[3][3][3] x = mat3[3][3][3] (mat3[3][3] (mat3[3] (a, a, a),
4107 mat3[3][3] (mat3[3] (b, b, b),
4111 mat3[3][3] (mat3[3] (c, c, c),
4113 mat3[3] (b, b, b)) );
4115 mat3 y[3][3][3] = x;
4117 mat3 x0 = y[0][0][0];
4118 mat3 x1 = y[1][0][0];
4119 mat3 x2 = y[2][0][0];
4121 float ret0 = x0[2][0];
4122 float ret1 = x1[0][2];
4123 float ret2 = x2[1][2];
4125 out0 = ivec3(ret0, ret1, ret2);
4133 desc "Testing assignment of arrays of arrays with explicit size"
4136 input bvec3 in0 = [ bvec3(true, false, true) ];
4137 output bvec3 out0 = [ bvec3(true, false, false) ];
4142 precision mediump float;
4149 mat3 a = mat3( in0.x, in0.y, in0.z,
4150 in0.x, in0.y, in0.z,
4151 in0.x, in0.y, in0.z);
4153 mat3 b = mat3( in0.z, in0.x, in0.y,
4154 in0.z, in0.x, in0.y,
4155 in0.z, in0.x, in0.y);
4157 mat3 c = mat3( in0.z, in0.z, in0.z,
4158 in0.y, in0.y, in0.y,
4159 in0.x, in0.x, in0.x);
4161 mat3[4] x[3] = mat3[3][4] ( mat3[4] (a, b, c, a),
4162 mat3[4] (b, c, a, b),
4163 mat3[4] (c, a, b, c) );
4171 float ret0 = x0[2][0];
4172 float ret1 = x1[0][2];
4173 float ret2 = x2[1][2];
4175 out0 = bvec3(ret0, ret1, ret2);
4181 end # explicit_to_explicit
4183 group explicit_to_implicit "Declaring an array of arrays with explicit size and assigning it to another array of arrays with implicit size"
4187 desc "Testing assignment of arrays of arrays from explicitly sized to implicitly sized"
4190 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
4191 output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
4196 precision mediump float;
4202 float x[3][3] = float[3][3] ( float[3] (in0.z, in0.x, in0.y),
4203 float[3] (in0.z, in0.x, in0.y),
4204 float[3] (in0.z, in0.x, in0.y) );
4208 out0 = vec3(y[0][0], y[1][1], y[2][2]);
4216 desc "Testing assignment of arrays of arrays from explicitly sized to implicitly sized"
4219 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
4220 output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
4225 precision mediump int;
4226 precision mediump float;
4232 int[2][3] x = int[2][3] ( int[3] (in0.z, in0.x, in0.y),
4233 int[3] (in0.z, in0.x, in0.y) );;
4236 out0 = ivec3(y[0][0], y[1][1], y[0][2]);
4244 desc "Testing assignment of arrays of arrays from explicitly sized to implicitly sized"
4247 input bvec3 in0 = [ bvec3(false, true, true) ];
4248 output bvec3 out0 = [ bvec3(true, false, true) ];
4253 precision mediump float;
4259 bool[3][3] x[3] = bool[3][3][3] (bool[3][3] (bool[3](in0.z, in0.z, in0.z),
4260 bool[3](in0.z, in0.z, in0.z),
4261 bool[3](in0.z, in0.z, in0.z)),
4263 bool[3][3] (bool[3](in0.x, in0.x, in0.x),
4264 bool[3](in0.x, in0.x, in0.x),
4265 bool[3](in0.x, in0.x, in0.x)),
4267 bool[3][3] (bool[3](in0.y, in0.y, in0.y),
4268 bool[3](in0.y, in0.y, in0.y),
4269 bool[3](in0.y, in0.y, in0.y)) );
4273 out0 = bvec3(y[0][0][0], y[1][1][1], y[2][2][2]);
4281 desc "Testing assignment of arrays of arrays from explicitly sized to implicitly sized"
4284 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
4285 output vec3 out0 = [ vec3(-1.0, -0.5, 2.0) ];
4290 precision mediump float;
4303 Test a = Test(in0.z, vec3(in0.x, in0.y, in0.z));
4304 Test b = Test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
4305 Test c = Test(in0.x, vec3(-in0.y, in0.z, -in0.x));
4307 Test[4] x[5][5] = Test[5][5][4] (Test[5][4] (Test[4] (c, c, c, c),
4308 Test[4] (b, b, b, b),
4309 Test[4] (a, a, a, a),
4310 Test[4] (c, c, c, c),
4311 Test[4] (b, b, b, b) ),
4313 Test[5][4] (Test[4] (a, a, a, a),
4314 Test[4] (b, b, b, b),
4315 Test[4] (c, c, c, c),
4316 Test[4] (a, a, a, a),
4317 Test[4] (b, b, b, b) ),
4319 Test[5][4] (Test[4] (b, b, b, b),
4320 Test[4] (c, c, c, c),
4321 Test[4] (a, a, a, a),
4322 Test[4] (b, b, b, b),
4323 Test[4] (c, c, c, c) ),
4325 Test[5][4] (Test[4] (c, c, c, c),
4326 Test[4] (b, b, b, b),
4327 Test[4] (a, a, a, a),
4328 Test[4] (c, c, c, c),
4329 Test[4] (b, b, b, b) ),
4331 Test[5][4] (Test[4] (a, a, a, a),
4332 Test[4] (b, b, b, b),
4333 Test[4] (c, c, c, c),
4334 Test[4] (a, a, a, a),
4335 Test[4] (b, b, b, b) ) );
4339 out0 = vec3(y[0][0][0].v.x, y[1][1][1].v.y, y[4][3][3].v.z);
4347 desc "Testing assignment of arrays of arrays from explicitly sized to implicitly sized"
4350 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
4351 output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(-0.5, 1.0, 11.2) ];
4356 precision mediump float;
4362 vec3 x[1][3] = vec3[1][3] ( vec3[3] (vec3(in0.x, in0.y, -in0.z),
4363 vec3(in0.y, -in0.z, in0.x),
4364 vec3(-in0.z, in0.x, in0.y)) );
4368 out0 = vec3(y[0][0].x, y[0][1].y, y[0][2].z);
4376 desc "Testing assignment of arrays of arrays from explicitly sized to implicitly sized"
4379 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(5, 11, -1) ];
4380 output ivec3 out0 = [ ivec3(0, -2, 1) | ivec3(5, 1, 11) ];
4385 precision mediump int;
4386 precision mediump float;
4392 ivec3[3][1][3] x = ivec3[3][1][3] ( ivec3[1][3] (ivec3[3] ( ivec3(in0.x, in0.y, -in0.z),
4393 ivec3(0.0, 0.0, 0.0),
4394 ivec3(0.0, 0.0, 0.0)) ),
4396 ivec3[1][3] (ivec3[3] ( ivec3(0.0, 0.0, 0.0),
4397 ivec3(in0.y, -in0.z, in0.x),
4398 ivec3(0.0, 0.0, 0.0)) ),
4400 ivec3[1][3] (ivec3[3] ( ivec3(0.0, 0.0, 0.0),
4401 ivec3(0.0, 0.0, 0.0),
4402 ivec3(-in0.z, in0.x, in0.y)) ) );
4406 out0 = ivec3(y[0][0][0].x, y[1][0][1].y, y[2][0][2].z);
4414 desc "Testing assignment of arrays of arrays from explicitly sized to implicitly sized"
4417 input bvec3 in0 = [ bvec3(true, false, true) ];
4418 output bvec3 out0 = [ bvec3(true, true, false) ];
4423 precision mediump float;
4429 bvec3[3][1] x = bvec3[3][1] ( bvec3[1] ( bvec3(in0.x, in0.y, in0.z)),
4430 bvec3[1] ( bvec3(in0.y, in0.z, in0.x)),
4431 bvec3[1] ( bvec3(in0.z, in0.x, in0.y)) );
4435 out0 = bvec3(y[0][0].x, y[1][0].y, y[2][0].z);
4443 desc "Testing assignment of arrays of arrays from explicitly sized to implicitly sized"
4446 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
4447 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
4452 precision mediump float;
4458 mat3[3][2] a = mat3[3][2] ( mat3[2] (mat3( in0.x, in0.y, in0.z,
4459 in0.x, in0.y, in0.z,
4460 in0.x, in0.y, in0.z),
4461 mat3( in0.z, in0.x, -in0.y,
4462 in0.z, in0.x, -in0.y,
4463 in0.z, in0.x, -in0.y)),
4465 mat3[2] (mat3( -in0.z, -in0.z, in0.z,
4466 -in0.y, -in0.y, in0.y,
4467 -in0.x, -in0.x, in0.x),
4468 mat3( in0.x, in0.y, in0.z,
4469 in0.x, in0.y, in0.z,
4470 in0.x, in0.y, in0.z)),
4472 mat3[2] (mat3( in0.z, in0.x, -in0.y,
4473 in0.z, in0.x, -in0.y,
4474 in0.z, in0.x, -in0.y),
4475 mat3( -in0.z, -in0.z, in0.z,
4476 -in0.y, -in0.y, in0.y,
4477 -in0.x, -in0.x, in0.x)) );
4485 float ret0 = a0[2][0];
4486 float ret1 = a1[0][2];
4487 float ret2 = a2[1][2];
4489 out0 = vec3(ret0, ret1, ret2);
4497 desc "Testing assignment of arrays of arrays from explicitly sized to implicitly sized"
4500 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
4501 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
4506 precision mediump int;
4507 precision mediump float;
4514 mat3 a = mat3( in0.x, in0.y, in0.z,
4515 in0.x, in0.y, in0.z,
4516 in0.x, in0.y, in0.z);
4517 mat3 b = mat3( in0.z, in0.x, -in0.y,
4518 in0.z, in0.x, -in0.y,
4519 in0.z, in0.x, -in0.y);
4520 mat3 c = mat3( -in0.z, -in0.z, in0.z,
4521 -in0.y, -in0.y, in0.y,
4522 -in0.x, -in0.x, in0.x);
4524 mat3[3][3][3] x = mat3[3][3][3] (mat3[3][3] (mat3[3] (a, a, a),
4528 mat3[3][3] (mat3[3] (b, b, b),
4532 mat3[3][3] (mat3[3] (c, c, c),
4534 mat3[3] (b, b, b)) );
4538 mat3 x0 = y[0][0][0];
4539 mat3 x1 = y[1][0][0];
4540 mat3 x2 = y[2][0][0];
4542 float ret0 = x0[2][0];
4543 float ret1 = x1[0][2];
4544 float ret2 = x2[1][2];
4546 out0 = ivec3(ret0, ret1, ret2);
4554 desc "Testing assignment of arrays of arrays from explicitly sized to implicitly sized"
4557 input bvec3 in0 = [ bvec3(true, false, true) ];
4558 output bvec3 out0 = [ bvec3(true, false, false) ];
4563 precision mediump float;
4570 mat3 a = mat3( in0.x, in0.y, in0.z,
4571 in0.x, in0.y, in0.z,
4572 in0.x, in0.y, in0.z);
4574 mat3 b = mat3( in0.z, in0.x, in0.y,
4575 in0.z, in0.x, in0.y,
4576 in0.z, in0.x, in0.y);
4578 mat3 c = mat3( in0.z, in0.z, in0.z,
4579 in0.y, in0.y, in0.y,
4580 in0.x, in0.x, in0.x);
4582 mat3[4] x[3] = mat3[3][4] ( mat3[4] (a, b, c, a),
4583 mat3[4] (b, c, a, b),
4584 mat3[4] (c, a, b, c) );
4592 float ret0 = x0[2][0];
4593 float ret1 = x1[0][2];
4594 float ret2 = x2[1][2];
4596 out0 = bvec3(ret0, ret1, ret2);
4602 end # explicit_to_implicit
4604 group implicit_to_explicit "Declaring an array of arrays with implicit size and assigning it to another array of arrays with explicit size"
4608 desc "Testing assignment of arrays of arrays from implicitly sized to explicitly sized"
4611 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
4612 output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
4617 precision mediump float;
4623 float x[][] = float[][] ( float[] (in0.z, in0.x, in0.y),
4624 float[] (in0.z, in0.x, in0.y),
4625 float[] (in0.z, in0.x, in0.y) );
4629 out0 = vec3(y[0][0], y[1][1], y[2][2]);
4637 desc "Testing assignment of arrays of arrays from implicitly sized to explicitly sized"
4640 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
4641 output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
4646 precision mediump int;
4647 precision mediump float;
4653 int[][] x = int[][] ( int[] (in0.z, in0.x, in0.y),
4654 int[] (in0.z, in0.x, in0.y) );;
4657 out0 = ivec3(y[0][0], y[1][1], y[0][2]);
4665 desc "Testing assignment of arrays of arrays from implicitly sized to explicitly sized"
4668 input bvec3 in0 = [ bvec3(false, true, true) ];
4669 output bvec3 out0 = [ bvec3(true, false, true) ];
4674 precision mediump float;
4680 bool[][] x[] = bool[][][] ( bool[][] ( bool[](in0.z, in0.z, in0.z),
4681 bool[](in0.z, in0.z, in0.z),
4682 bool[](in0.z, in0.z, in0.z)),
4684 bool[][] ( bool[](in0.x, in0.x, in0.x),
4685 bool[](in0.x, in0.x, in0.x),
4686 bool[](in0.x, in0.x, in0.x)),
4688 bool[][] ( bool[](in0.y, in0.y, in0.y),
4689 bool[](in0.y, in0.y, in0.y),
4690 bool[](in0.y, in0.y, in0.y)) );
4692 bool[3] y[3][3] = x;
4694 out0 = bvec3(y[0][0][0], y[1][1][1], y[2][2][2]);
4702 desc "Testing assignment of arrays of arrays from implicitly sized to explicitly sized"
4705 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
4706 output vec3 out0 = [ vec3(-1.0, -0.5, 2.0) ];
4711 precision mediump float;
4724 Test a = Test(in0.z, vec3(in0.x, in0.y, in0.z));
4725 Test b = Test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
4726 Test c = Test(in0.x, vec3(-in0.y, in0.z, -in0.x));
4728 Test[] x[][] = Test[][][] ( Test[][] ( Test[] (c, c, c, c),
4729 Test[] (b, b, b, b),
4730 Test[] (a, a, a, a),
4731 Test[] (c, c, c, c),
4732 Test[] (b, b, b, b) ),
4734 Test[][] ( Test[] (a, a, a, a),
4735 Test[] (b, b, b, b),
4736 Test[] (c, c, c, c),
4737 Test[] (a, a, a, a),
4738 Test[] (b, b, b, b) ),
4740 Test[][] ( Test[] (b, b, b, b),
4741 Test[] (c, c, c, c),
4742 Test[] (a, a, a, a),
4743 Test[] (b, b, b, b),
4744 Test[] (c, c, c, c) ),
4746 Test[][] ( Test[] (c, c, c, c),
4747 Test[] (b, b, b, b),
4748 Test[] (a, a, a, a),
4749 Test[] (c, c, c, c),
4750 Test[] (b, b, b, b) ),
4752 Test[][] ( Test[] (a, a, a, a),
4753 Test[] (b, b, b, b),
4754 Test[] (c, c, c, c),
4755 Test[] (a, a, a, a),
4756 Test[] (b, b, b, b) ) );
4758 Test y[5][5][4] = x;
4760 out0 = vec3(y[0][0][0].v.x, y[1][1][1].v.y, y[4][3][3].v.z);
4768 desc "Testing assignment of arrays of arrays from implicitly sized to explicitly sized"
4771 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
4772 output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(-0.5, 1.0, 11.2) ];
4777 precision mediump float;
4783 vec3 x[][] = vec3[][] ( vec3[] (vec3(in0.x, in0.y, -in0.z),
4784 vec3(in0.y, -in0.z, in0.x),
4785 vec3(-in0.z, in0.x, in0.y)) );
4789 out0 = vec3(y[0][0].x, y[0][1].y, y[0][2].z);
4797 desc "Testing assignment of arrays of arrays from implicitly sized to explicitly sized"
4800 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(5, 11, -1) ];
4801 output ivec3 out0 = [ ivec3(0, -2, 1) | ivec3(5, 1, 11) ];
4806 precision mediump int;
4807 precision mediump float;
4813 ivec3[][][] x = ivec3[][][] ( ivec3[][] ( ivec3[] ( ivec3(in0.x, in0.y, -in0.z),
4814 ivec3(0.0, 0.0, 0.0),
4815 ivec3(0.0, 0.0, 0.0)) ),
4817 ivec3[][] ( ivec3[] ( ivec3(0.0, 0.0, 0.0),
4818 ivec3(in0.y, -in0.z, in0.x),
4819 ivec3(0.0, 0.0, 0.0)) ),
4821 ivec3[][] ( ivec3[] ( ivec3(0.0, 0.0, 0.0),
4822 ivec3(0.0, 0.0, 0.0),
4823 ivec3(-in0.z, in0.x, in0.y)) ) );
4825 ivec3[3] y[3][1] = x;
4827 out0 = ivec3(y[0][0][0].x, y[1][0][1].y, y[2][0][2].z);
4835 desc "Testing assignment of arrays of arrays from implicitly sized to explicitly sized"
4838 input bvec3 in0 = [ bvec3(true, false, true) ];
4839 output bvec3 out0 = [ bvec3(true, true, false) ];
4844 precision mediump float;
4850 bvec3[][] x = bvec3[][] ( bvec3[] ( bvec3(in0.x, in0.y, in0.z)),
4851 bvec3[] ( bvec3(in0.y, in0.z, in0.x)),
4852 bvec3[] ( bvec3(in0.z, in0.x, in0.y)) );
4856 out0 = bvec3(y[0][0].x, y[1][0].y, y[2][0].z);
4864 desc "Testing assignment of arrays of arrays from implicitly sized to explicitly sized"
4867 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
4868 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
4873 precision mediump float;
4879 mat3[][] a = mat3[][] ( mat3[] ( mat3( in0.x, in0.y, in0.z,
4880 in0.x, in0.y, in0.z,
4881 in0.x, in0.y, in0.z),
4882 mat3( in0.z, in0.x, -in0.y,
4883 in0.z, in0.x, -in0.y,
4884 in0.z, in0.x, -in0.y)),
4886 mat3[] ( mat3( -in0.z, -in0.z, in0.z,
4887 -in0.y, -in0.y, in0.y,
4888 -in0.x, -in0.x, in0.x),
4889 mat3( in0.x, in0.y, in0.z,
4890 in0.x, in0.y, in0.z,
4891 in0.x, in0.y, in0.z)),
4893 mat3[] ( mat3( in0.z, in0.x, -in0.y,
4894 in0.z, in0.x, -in0.y,
4895 in0.z, in0.x, -in0.y),
4896 mat3( -in0.z, -in0.z, in0.z,
4897 -in0.y, -in0.y, in0.y,
4898 -in0.x, -in0.x, in0.x)) );
4906 float ret0 = a0[2][0];
4907 float ret1 = a1[0][2];
4908 float ret2 = a2[1][2];
4910 out0 = vec3(ret0, ret1, ret2);
4918 desc "Testing assignment of arrays of arrays from implicitly sized to explicitly sized"
4921 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
4922 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
4927 precision mediump int;
4928 precision mediump float;
4935 mat3 a = mat3( in0.x, in0.y, in0.z,
4936 in0.x, in0.y, in0.z,
4937 in0.x, in0.y, in0.z);
4938 mat3 b = mat3( in0.z, in0.x, -in0.y,
4939 in0.z, in0.x, -in0.y,
4940 in0.z, in0.x, -in0.y);
4941 mat3 c = mat3( -in0.z, -in0.z, in0.z,
4942 -in0.y, -in0.y, in0.y,
4943 -in0.x, -in0.x, in0.x);
4945 mat3[][][] x = mat3[][][] ( mat3[][] ( mat3[] (a, a, a),
4949 mat3[][] ( mat3[] (b, b, b),
4953 mat3[][] ( mat3[] (c, c, c),
4955 mat3[] (b, b, b)) );
4957 mat3 y[3][3][3] = x;
4959 mat3 x0 = y[0][0][0];
4960 mat3 x1 = y[1][0][0];
4961 mat3 x2 = y[2][0][0];
4963 float ret0 = x0[2][0];
4964 float ret1 = x1[0][2];
4965 float ret2 = x2[1][2];
4967 out0 = ivec3(ret0, ret1, ret2);
4975 desc "Testing assignment of arrays of arrays from implicitly sized to explicitly sized"
4978 input bvec3 in0 = [ bvec3(true, false, true) ];
4979 output bvec3 out0 = [ bvec3(true, false, false) ];
4984 precision mediump float;
4991 mat3 a = mat3( in0.x, in0.y, in0.z,
4992 in0.x, in0.y, in0.z,
4993 in0.x, in0.y, in0.z);
4995 mat3 b = mat3( in0.z, in0.x, in0.y,
4996 in0.z, in0.x, in0.y,
4997 in0.z, in0.x, in0.y);
4999 mat3 c = mat3( in0.z, in0.z, in0.z,
5000 in0.y, in0.y, in0.y,
5001 in0.x, in0.x, in0.x);
5003 mat3[] x[] = mat3[][] ( mat3[] (a, b, c, a),
5004 mat3[] (b, c, a, b),
5005 mat3[] (c, a, b, c) );
5013 float ret0 = x0[2][0];
5014 float ret1 = x1[0][2];
5015 float ret2 = x2[1][2];
5017 out0 = bvec3(ret0, ret1, ret2);
5023 end # implicit_to_explicit
5025 group implicit_to_implicit "Declaring an array of arrays with implicit size and assigning it to another array of arrays with implicit size"
5029 desc "Testing assignment of arrays of arrays with implicit sizes"
5032 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(7.4, -1.0, 2.0) | vec3(3.0, 1.6, -2.0) ];
5033 output vec3 out0 = [ vec3(2.0, 0.5, 1.0) | vec3(2.0, 7.4, -1.0) | vec3(-2.0, 3.0, 1.6) ];
5038 precision mediump float;
5044 float x[][] = float[][] ( float[] (in0.z, in0.x, in0.y),
5045 float[] (in0.z, in0.x, in0.y),
5046 float[] (in0.z, in0.x, in0.y) );
5050 out0 = vec3(y[0][0], y[1][1], y[2][2]);
5058 desc "Testing assignment of arrays of arrays with implicit sizes"
5061 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(7, -1, 2) | ivec3(3, 1, -2) ];
5062 output ivec3 out0 = [ ivec3(2, 0, 1) | ivec3(2, 7, -1) | ivec3(-2, 3, 1) ];
5067 precision mediump int;
5068 precision mediump float;
5074 int[][] x = int[][] ( int[] (in0.z, in0.x, in0.y),
5075 int[] (in0.z, in0.x, in0.y) );;
5078 out0 = ivec3(y[0][0], y[1][1], y[0][2]);
5086 desc "Testing assignment of arrays of arrays with implicit sizes"
5089 input bvec3 in0 = [ bvec3(false, true, true) ];
5090 output bvec3 out0 = [ bvec3(true, false, true) ];
5095 precision mediump float;
5101 bool[][] x[] = bool[][][] ( bool[][] ( bool[](in0.z, in0.z, in0.z),
5102 bool[](in0.z, in0.z, in0.z),
5103 bool[](in0.z, in0.z, in0.z)),
5105 bool[][] ( bool[](in0.x, in0.x, in0.x),
5106 bool[](in0.x, in0.x, in0.x),
5107 bool[](in0.x, in0.x, in0.x)),
5109 bool[][] ( bool[](in0.y, in0.y, in0.y),
5110 bool[](in0.y, in0.y, in0.y),
5111 bool[](in0.y, in0.y, in0.y)) );
5115 out0 = bvec3(y[0][0][0], y[1][1][1], y[2][2][2]);
5123 desc "Testing assignment of arrays of arrays with implicit sizes"
5126 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
5127 output vec3 out0 = [ vec3(-1.0, -0.5, 2.0) ];
5132 precision mediump float;
5145 Test a = Test(in0.z, vec3(in0.x, in0.y, in0.z));
5146 Test b = Test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
5147 Test c = Test(in0.x, vec3(-in0.y, in0.z, -in0.x));
5149 Test[] x[][] = Test[][][] ( Test[][] ( Test[] (c, c, c, c),
5150 Test[] (b, b, b, b),
5151 Test[] (a, a, a, a),
5152 Test[] (c, c, c, c),
5153 Test[] (b, b, b, b) ),
5155 Test[][] ( Test[] (a, a, a, a),
5156 Test[] (b, b, b, b),
5157 Test[] (c, c, c, c),
5158 Test[] (a, a, a, a),
5159 Test[] (b, b, b, b) ),
5161 Test[][] ( Test[] (b, b, b, b),
5162 Test[] (c, c, c, c),
5163 Test[] (a, a, a, a),
5164 Test[] (b, b, b, b),
5165 Test[] (c, c, c, c) ),
5167 Test[][] ( Test[] (c, c, c, c),
5168 Test[] (b, b, b, b),
5169 Test[] (a, a, a, a),
5170 Test[] (c, c, c, c),
5171 Test[] (b, b, b, b) ),
5173 Test[][] ( Test[] (a, a, a, a),
5174 Test[] (b, b, b, b),
5175 Test[] (c, c, c, c),
5176 Test[] (a, a, a, a),
5177 Test[] (b, b, b, b) ) );
5181 out0 = vec3(y[0][0][0].v.x, y[1][1][1].v.y, y[4][3][3].v.z);
5189 desc "Testing assignment of arrays of arrays with implicit sizes"
5192 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-0.5, 11.2, -1.0) ];
5193 output vec3 out0 = [ vec3(0.5, -2.0, 1.0) | vec3(-0.5, 1.0, 11.2) ];
5198 precision mediump float;
5204 vec3 x[][] = vec3[][] ( vec3[] (vec3(in0.x, in0.y, -in0.z) ,
5205 vec3(in0.y, -in0.z, in0.x) ,
5206 vec3(-in0.z, in0.x, in0.y)) );
5210 out0 = vec3(y[0][0].x, y[0][1].y, y[0][2].z);
5218 desc "Testing assignment of arrays of arrays with implicit sizes"
5221 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(5, 11, -1) ];
5222 output ivec3 out0 = [ ivec3(0, -2, 1) | ivec3(5, 1, 11) ];
5227 precision mediump int;
5228 precision mediump float;
5234 ivec3[][][] x = ivec3[][][] ( ivec3[][] ( ivec3[] ( ivec3(in0.x, in0.y, -in0.z),
5235 ivec3(0.0, 0.0, 0.0),
5236 ivec3(0.0, 0.0, 0.0)) ),
5238 ivec3[][] ( ivec3[] ( ivec3(0.0, 0.0, 0.0),
5239 ivec3(in0.y, -in0.z, in0.x),
5240 ivec3(0.0, 0.0, 0.0)) ),
5242 ivec3[][] ( ivec3[] ( ivec3(0.0, 0.0, 0.0),
5243 ivec3(0.0, 0.0, 0.0),
5244 ivec3(-in0.z, in0.x, in0.y)) ) );
5248 out0 = ivec3(y[0][0][0].x, y[1][0][1].y, y[2][0][2].z);
5256 desc "Testing assignment of arrays of arrays with implicit sizes"
5259 input bvec3 in0 = [ bvec3(true, false, true) ];
5260 output bvec3 out0 = [ bvec3(true, true, false) ];
5265 precision mediump float;
5271 bvec3[][] x = bvec3[][] ( bvec3[] ( bvec3(in0.x, in0.y, in0.z)),
5272 bvec3[] ( bvec3(in0.y, in0.z, in0.x)),
5273 bvec3[] ( bvec3(in0.z, in0.x, in0.y)) );
5277 out0 = bvec3(y[0][0].x, y[1][0].y, y[2][0].z);
5285 desc "Testing assignment of arrays of arrays with implicit sizes"
5288 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) | vec3(-1.5, 0.0, -2.3) ];
5289 output vec3 out0 = [ vec3(0.5, -1.0, 1.0) | vec3(-1.5, 0.0, 0.0) ];
5294 precision mediump float;
5300 mat3[][] a = mat3[][] ( mat3[] ( mat3( in0.x, in0.y, in0.z,
5301 in0.x, in0.y, in0.z,
5302 in0.x, in0.y, in0.z),
5303 mat3( in0.z, in0.x, -in0.y,
5304 in0.z, in0.x, -in0.y,
5305 in0.z, in0.x, -in0.y)),
5307 mat3[] ( mat3( -in0.z, -in0.z, in0.z,
5308 -in0.y, -in0.y, in0.y,
5309 -in0.x, -in0.x, in0.x),
5310 mat3( in0.x, in0.y, in0.z,
5311 in0.x, in0.y, in0.z,
5312 in0.x, in0.y, in0.z)),
5314 mat3[] ( mat3( in0.z, in0.x, -in0.y,
5315 in0.z, in0.x, -in0.y,
5316 in0.z, in0.x, -in0.y),
5317 mat3( -in0.z, -in0.z, in0.z,
5318 -in0.y, -in0.y, in0.y,
5319 -in0.x, -in0.x, in0.x)) );
5327 float ret0 = a0[2][0];
5328 float ret1 = a1[0][2];
5329 float ret2 = a2[1][2];
5331 out0 = vec3(ret0, ret1, ret2);
5339 desc "Testing assignment of arrays of arrays with implicit sizes"
5342 input ivec3 in0 = [ ivec3(0, 1, 2) | ivec3(-1, 0, -2) ];
5343 output ivec3 out0 = [ ivec3(0, -1, 1) | ivec3(-1, 0, 0) ];
5348 precision mediump int;
5349 precision mediump float;
5356 mat3 a = mat3( in0.x, in0.y, in0.z,
5357 in0.x, in0.y, in0.z,
5358 in0.x, in0.y, in0.z);
5359 mat3 b = mat3( in0.z, in0.x, -in0.y,
5360 in0.z, in0.x, -in0.y,
5361 in0.z, in0.x, -in0.y);
5362 mat3 c = mat3( -in0.z, -in0.z, in0.z,
5363 -in0.y, -in0.y, in0.y,
5364 -in0.x, -in0.x, in0.x);
5366 mat3[][][] x = mat3[][][] ( mat3[][] ( mat3[] (a, a, a),
5370 mat3[][] ( mat3[] (b, b, b),
5374 mat3[][] ( mat3[] (c, c, c),
5376 mat3[] (b, b, b)) );
5380 mat3 x0 = y[0][0][0];
5381 mat3 x1 = y[1][0][0];
5382 mat3 x2 = y[2][0][0];
5384 float ret0 = x0[2][0];
5385 float ret1 = x1[0][2];
5386 float ret2 = x2[1][2];
5388 out0 = ivec3(ret0, ret1, ret2);
5396 desc "Testing assignment of arrays of arrays with implicit sizes"
5399 input bvec3 in0 = [ bvec3(true, false, true) ];
5400 output bvec3 out0 = [ bvec3(true, false, false) ];
5405 precision mediump float;
5412 mat3 a = mat3( in0.x, in0.y, in0.z,
5413 in0.x, in0.y, in0.z,
5414 in0.x, in0.y, in0.z);
5416 mat3 b = mat3( in0.z, in0.x, in0.y,
5417 in0.z, in0.x, in0.y,
5418 in0.z, in0.x, in0.y);
5420 mat3 c = mat3( in0.z, in0.z, in0.z,
5421 in0.y, in0.y, in0.y,
5422 in0.x, in0.x, in0.x);
5424 mat3[] x[] = mat3[][] ( mat3[] (a, b, c, a),
5425 mat3[] (b, c, a, b),
5426 mat3[] (c, a, b, c) );
5434 float ret0 = x0[2][0];
5435 float ret1 = x1[0][2];
5436 float ret2 = x2[1][2];
5438 out0 = bvec3(ret0, ret1, ret2);
5444 end # implicit_to_implicit
5448 group length "Testing the array length property with arrays of arrays"
5452 desc "Testing the array length property with arrays of arrays"
5455 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
5456 output ivec2 out0 = [ ivec2(3, 5) ];
5457 output ivec3 out1 = [ ivec3(3, 4, 5) ];
5458 output ivec3 out2 = [ ivec3(1, 2, 13) ];
5463 precision mediump float;
5469 float[][] x = float[3][5] ( float[5] (in0.z, in0.x, in0.y, in0.x, in0.y),
5470 float[5] (in0.z, in0.x, in0.y, in0.x, in0.y),
5471 float[5] (in0.z, in0.x, in0.y, in0.x, in0.y) );
5473 float[][] y[] = float[][][] ( float[][] ( float[] (in0.z, in0.x, in0.y, in0.x, in0.y),
5474 float[] (in0.z, in0.x, in0.y, in0.x, in0.y),
5475 float[] (in0.z, in0.x, in0.y, in0.x, in0.y),
5476 float[] (in0.z, in0.x, in0.y, in0.x, in0.y) ),
5478 float[][] ( float[] (in0.z, in0.x, in0.y, in0.x, in0.y),
5479 float[] (in0.z, in0.x, in0.y, in0.x, in0.y),
5480 float[] (in0.z, in0.x, in0.y, in0.x, in0.y),
5481 float[] (in0.z, in0.x, in0.y, in0.x, in0.y) ),
5483 float[][] ( float[] (in0.z, in0.x, in0.y, in0.x, in0.y),
5484 float[] (in0.z, in0.x, in0.y, in0.x, in0.y),
5485 float[] (in0.z, in0.x, in0.y, in0.x, in0.y),
5486 float[] (in0.z, in0.x, in0.y, in0.x, in0.y) ) );
5490 out0 = ivec2(x.length(), x[0].length());
5491 out1 = ivec3(y.length(), y[0].length(), y[0][0].length());
5492 out2 = ivec3(z.length(), z[0].length(), z[0][0].length());
5500 desc "Testing the array length property with arrays of arrays"
5503 input ivec3 in0 = [ ivec3(0, 1, 2) ];
5504 output ivec2 out0 = [ ivec2(2, 7) ];
5505 output ivec3 out1 = [ ivec3(1, 2, 3) ];
5506 output ivec3 out2 = [ ivec3(13, 7, 1) ];
5511 precision mediump int;
5512 precision mediump float;
5519 int[] x[] = int[][] ( int[] (in0.z, in0.x, in0.y, in0.x, in0.y, in0.z, in0.x),
5520 int[] (in0.z, in0.x, in0.y, in0.x, in0.y, in0.z, in0.x) );
5522 int[] y[][] = int[1][2][3] ( int[2][3] ( int[3] (in0.z, in0.x, in0.y),
5523 int[3] (in0.z, in0.x, in0.y) ));
5527 out0 = ivec2(x.length(), x[0].length());
5528 out1 = ivec3(y.length(), y[0].length(), y[0][0].length());
5529 out2 = ivec3(z.length(), z[0].length(), z[0][0].length());
5537 desc "Testing the array length property with arrays of arrays"
5540 input bvec3 in0 = [ bvec3(true, false, true) ];
5541 output ivec2 out0 = [ ivec2(4, 3) ];
5542 output ivec3 out1 = [ ivec3(2, 1, 3) ];
5543 output ivec3 out2 = [ ivec3(7, 8, 9) ];
5548 precision mediump float;
5554 bool x[4][3] = bool[][] ( bool[] (in0.z, in0.x, in0.y),
5555 bool[] (in0.z, in0.x, in0.y),
5556 bool[] (in0.z, in0.x, in0.y),
5557 bool[] (in0.z, in0.x, in0.y) );
5559 bool y[2][1][3] = bool[][][] ( bool[][] ( bool[] (in0.z, in0.x, in0.y) ),
5560 bool[][] ( bool[] (in0.z, in0.x, in0.y) ) );
5564 out0 = ivec2(x.length(), x[0].length());
5565 out1 = ivec3(y.length(), y[0].length(), y[0][0].length());
5566 out2 = ivec3(z.length(), z[0].length(), z[0][0].length());
5574 desc "Testing the array length property with arrays of arrays"
5577 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
5578 output ivec2 out0 = [ ivec2(5, 1) ];
5579 output ivec3 out1 = [ ivec3(5, 4, 2) ];
5580 output ivec3 out2 = [ ivec3(100, 101, 102) ];
5585 precision mediump float;
5598 Test a = Test(in0.z, vec3(in0.x, in0.y, in0.z));
5599 Test b = Test(in0.y, vec3(-in0.z, -in0.x, -in0.y));
5600 Test c = Test(in0.x, vec3(-in0.y, in0.z, -in0.x));
5602 Test x[5][1] = Test[5][1] ( Test[1] (a),
5608 Test y[][][] = Test[][][] ( Test[][] ( Test[] (a, b),
5612 Test[][] ( Test[] (a, b),
5616 Test[][] ( Test[] (a, b),
5620 Test[][] ( Test[] (a, b),
5624 Test[][] ( Test[] (a, b),
5629 int z[100][101][102];
5631 out0 = ivec2(x.length(), x[0].length());
5632 out1 = ivec3(y.length(), y[0].length(), y[0][0].length());
5633 out2 = ivec3(z.length(), z[0].length(), z[0][0].length());
5641 desc "Testing the array length property with arrays of arrays"
5644 input ivec3 in0 = [ ivec3(0, 1, 2)];
5645 output ivec2 out0 = [ ivec2(3, 4) ];
5646 output ivec3 out1 = [ ivec3(1, 2, 4) ];
5647 output ivec3 out2 = [ ivec3(3, 101, 88) ];
5652 precision mediump int;
5653 precision mediump float;
5660 mat3 a = mat3( in0.x, in0.y, in0.z,
5661 in0.x, in0.y, in0.z,
5662 in0.x, in0.y, in0.z);
5663 mat3 b = mat3( in0.z, in0.x, -in0.y,
5664 in0.z, in0.x, -in0.y,
5665 in0.z, in0.x, -in0.y);
5666 mat3 c = mat3( -in0.z, -in0.z, in0.z,
5667 -in0.y, -in0.y, in0.y,
5668 -in0.x, -in0.x, in0.x);
5670 mat3[3][4] x = mat3[][] ( mat3[] (a, a, a, a),
5671 mat3[] (b, b, b, b),
5672 mat3[] (c, c, c, c) );
5674 mat3 y[][][] = mat3[][][] ( mat3[][] ( mat3[] (a, a, a, a),
5675 mat3[] (b, b, b, b) ) );
5680 out0 = ivec2(x.length(), x[0].length());
5681 out1 = ivec3(y.length(), y[0].length(), y[0][0].length());
5682 out2 = ivec3(z.length(), z[0].length(), z[0][0].length());
5688 case constant_expression
5690 desc "Testing the array length property with arrays of arrays"
5693 input ivec3 in0 = [ ivec3(0, 1, 2) ];
5694 output ivec3 out0 = [ ivec3(2, 7, 3) ];
5699 precision mediump int;
5700 precision mediump float;
5707 int[] x[] = int[][] ( int[] (in0.z, in0.x, in0.y, in0.x, in0.y, in0.z, in0.x),
5708 int[] (in0.z, in0.x, in0.y, in0.x, in0.y, in0.z, in0.x) );
5710 int[] y[][] = int[1][2][3] ( int[2][3] ( int[3] (in0.z, in0.x, in0.y),
5711 int[3] (in0.z, in0.x, in0.y) ));
5715 int ret[x.length()][z[0].length()][y[0][0].length()];
5716 out0 = ivec3(ret.length(), ret[0].length(), ret[0][0].length());
5724 group array_access "Test accessing arrays of arrays"
5726 case constant_expression_access
5728 desc "Testing accessing arrays of arrays"
5731 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
5732 output vec3 out0 = [ vec3(-1.0, 0.5, -0.5) ];
5737 precision mediump float;
5746 float x = float[2][6] ( float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
5747 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z) ) [a][a];
5749 float y = float[][][] ( float[][] ( float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
5750 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z) ),
5751 float[][] ( float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
5752 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z) ),
5753 float[][] ( float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
5754 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z) ),
5755 float[][] ( float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
5756 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z) ),
5757 float[][] ( float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
5758 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z) )) [b+2][b-1][b+1];
5760 float z = float[][] ( float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z),
5761 float[] (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
5762 float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) ) [2][5];
5764 out0 = vec3(x, y, z);
5768 end # constant_expression_access
5770 case dynamic_expression_access
5772 desc "Testing accessing arrays of arrays"
5775 input vec3 in0 = [ vec3(0.5, 1.0, 2.0) ];
5776 input ivec3 in1 = ivec3(3, 2, 1);
5777 output vec3 out0 = [ vec3(0.5, 2.0, -1.0) ];
5782 precision mediump float;
5788 float x = float[2][6] ( float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
5789 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z) ) [in1.z][in1.x];
5791 float y = float[][][] ( float[][] ( float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
5792 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z) ),
5793 float[][] ( float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
5794 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z) ),
5795 float[][] ( float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
5796 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z) ),
5797 float[][] ( float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
5798 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z) ),
5799 float[][] ( float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x),
5800 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z) )) [in1.x+1][in1.y-1][in1.z+4];
5802 float z = float[][] ( float[] (0.0, 0.0, 0.0, 0.0, 0.0, 0.0),
5803 float[] (-in0.z, -in0.y, -in0.x, in0.x, in0.y, in0.z),
5804 float[] (in0.x, in0.y, in0.z, -in0.z, -in0.y, -in0.x) ) [in1.x-in1.y][in1.z];
5806 out0 = vec3(x, y, z);
5810 end # dynamic_expression_access
5815 group single_statement_multiple_declarations "Testing multiple arrays of arrays declarations in a single statement"
5817 group explicit_constructor "Testing single statement with multiple arrays of arrays with explicit constructor"
5819 case float_2_dimensions
5821 desc "Testing multiple two dimensional array declarations in a single statement"
5824 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) ];
5825 output vec4 out0 = [ vec4(2.5, 0.7, 2.0, 2.5) | vec4(9.4, 6.1, -2.0, 9.4) | vec4(1.0, 3.5, 3.2, 1.0) ];
5830 precision mediump float;
5836 float[][] x = float[3][3] ( float[3] (in0.z, in0.x, in0.y),
5837 float[3] (in0.z, in0.x, in0.y),
5838 float[3] (in0.z, in0.x, in0.y) ),
5840 y = float[3][4] ( float[4] (in0.z, in0.x, in0.w, in0.y),
5841 float[4] (in0.z, in0.x, in0.w, in0.y),
5842 float[4] (in0.z, in0.x, in0.w, in0.y) );
5844 out0 = vec4(x[0][0]+y[1][1], x[1][1]+y[2][2], x[2][2]+y[2][3], x[0][1]+y[0][0]);
5850 case int_3_dimensions
5852 desc "Testing multiple three dimensional array declarations in a single statement"
5855 input ivec4 in0 = [ ivec4(0, 1, 2, 0) | ivec4(7, -1, 2, -1) | ivec4(3, 1, -2, 0) ];
5856 output ivec4 out0 = [ ivec4(2, 1, 2, 1) | ivec4(9, 6, 1, -2) | ivec4(1, 4, -2, 1) ];
5861 precision mediump int;
5862 precision mediump float;
5868 int[][][] x = int[4][4][4] (int[4][4] ( (int[4] (in0.z, in0.x, in0.w, in0.y)),
5869 (int[4] (in0.z, in0.x, in0.w, in0.y)),
5870 (int[4] (in0.z, in0.x, in0.w, in0.y)),
5871 (int[4] (in0.z, in0.x, in0.w, in0.y))),
5873 int[4][4] ( (int[4] (in0.z, in0.x, in0.w, in0.y)),
5874 (int[4] (in0.z, in0.x, in0.w, in0.y)),
5875 (int[4] (in0.z, in0.x, in0.w, in0.y)),
5876 (int[4] (in0.z, in0.x, in0.w, in0.y))),
5878 int[4][4] ( (int[4] (in0.z, in0.x, in0.w, in0.y)),
5879 (int[4] (in0.z, in0.x, in0.w, in0.y)),
5880 (int[4] (in0.z, in0.x, in0.w, in0.y)),
5881 (int[4] (in0.z, in0.x, in0.w, in0.y))),
5883 int[4][4] ( (int[4] (in0.z, in0.x, in0.w, in0.y)),
5884 (int[4] (in0.z, in0.x, in0.w, in0.y)),
5885 (int[4] (in0.z, in0.x, in0.w, in0.y)),
5886 (int[4] (in0.z, in0.x, in0.w, in0.y))) ),
5888 y = int[2][2][4] (int[2][4] ( (int[4] (in0.x, in0.y, in0.z, in0.w)),
5889 (int[4] (in0.x, in0.y, in0.z, in0.w))),
5891 int[2][4] ( (int[4] (in0.x, in0.y, in0.z, in0.w)),
5892 (int[4] (in0.x, in0.y, in0.z, in0.w))) );
5894 out0 = ivec4(x[0][0][0] + y[0][0][0], x[1][1][1] + y[1][1][1], x[2][2][2] + y[0][0][2], x[3][3][3] + y[0][0][3]);
5900 end # explicit_constructor
5902 group implicit_constructor "Testing single statement with multiple arrays of arrays with implicit constructor"
5904 case float_2_dimensions
5906 desc "Testing multiple two dimensional array declarations in a single statement"
5909 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) ];
5910 output vec4 out0 = [ vec4(2.5, 0.7, 2.0, 2.5) | vec4(9.4, 6.1, -2.0, 9.4) | vec4(1.0, 3.5, 3.2, 1.0) ];
5915 precision mediump float;
5921 float[][] x = float[][] (float[] (in0.z, in0.x, in0.y),
5922 float[] (in0.z, in0.x, in0.y),
5923 float[] (in0.z, in0.x, in0.y) ),
5925 y = float[][] (float[] (in0.z, in0.x, in0.w, in0.y),
5926 float[] (in0.z, in0.x, in0.w, in0.y),
5927 float[] (in0.z, in0.x, in0.w, in0.y) );
5929 out0 = vec4(x[0][0]+y[1][1], x[1][1]+y[2][2], x[2][2]+y[2][3], x[0][1]+y[0][0]);
5935 case int_3_dimensions
5937 desc "Testing multiple three dimensional array declarations in a single statement"
5940 input ivec4 in0 = [ ivec4(0, 1, 2, 0) | ivec4(7, -1, 2, -1) | ivec4(3, 1, -2, 0) ];
5941 output ivec4 out0 = [ ivec4(2, 1, 2, 1) | ivec4(9, 6, 1, -2) | ivec4(1, 4, -2, 1) ];
5946 precision mediump int;
5947 precision mediump float;
5953 int[][][] x = int[][][] (int[][] ( (int[] (in0.z, in0.x, in0.w, in0.y)),
5954 (int[] (in0.z, in0.x, in0.w, in0.y)),
5955 (int[] (in0.z, in0.x, in0.w, in0.y)),
5956 (int[] (in0.z, in0.x, in0.w, in0.y))),
5958 int[][] ( (int[] (in0.z, in0.x, in0.w, in0.y)),
5959 (int[] (in0.z, in0.x, in0.w, in0.y)),
5960 (int[] (in0.z, in0.x, in0.w, in0.y)),
5961 (int[] (in0.z, in0.x, in0.w, in0.y))),
5963 int[][] ( (int[] (in0.z, in0.x, in0.w, in0.y)),
5964 (int[] (in0.z, in0.x, in0.w, in0.y)),
5965 (int[] (in0.z, in0.x, in0.w, in0.y)),
5966 (int[] (in0.z, in0.x, in0.w, in0.y))),
5968 int[][] ( (int[] (in0.z, in0.x, in0.w, in0.y)),
5969 (int[] (in0.z, in0.x, in0.w, in0.y)),
5970 (int[] (in0.z, in0.x, in0.w, in0.y)),
5971 (int[] (in0.z, in0.x, in0.w, in0.y))) ),
5973 y = int[][][] (int[][] ( (int[] (in0.x, in0.y, in0.z, in0.w)),
5974 (int[] (in0.x, in0.y, in0.z, in0.w))),
5976 int[][] ((int[] (in0.x, in0.y, in0.z, in0.w)),
5977 (int[] (in0.x, in0.y, in0.z, in0.w))) );
5979 out0 = ivec4(x[0][0][0] + y[0][0][0], x[1][1][1] + y[1][1][1], x[2][2][2] + y[0][0][2], x[3][3][3] + y[0][0][3]);
5985 end # implicit_constructor
5987 end # single_statement_multiple_declarations
5990 group invalid "Invalid functions"
5992 case dynamic_expression_array_size
5994 desc "Testing that compiler doesn't allow dynamic expressions in arrays of arrays sizes"
5999 precision mediump float;
6006 ${POSITION_FRAG_COLOR} = vec4(1.0);
6009 end # dynamic_expression_array_size
6011 case empty_declaration_without_var_name
6013 desc "Testing that compiler doesn't allow only an empty declaration"
6014 expect compile_or_link_fail
6018 precision mediump float;
6024 ${POSITION_FRAG_COLOR} = vec4(1.0);
6027 end # empty_declaration_without_var_name
6029 case empty_declaration_with_var_name
6031 desc "Testing that compiler doesn't allow only an empty declaration"
6032 expect compile_or_link_fail
6036 precision mediump float;
6042 ${POSITION_FRAG_COLOR} = vec4(1.0);
6045 end # empty_declaration_with_var_name
6049 desc "Testing that compiler doesn't allow arrays of arrays of uniform blocks"
6050 expect compile_or_link_fail
6054 precision mediump float;
6057 layout(std140) uniform Transform {
6058 mat4 modelViewMatrix;
6059 mat4 modelViewProjectionMatrix;
6062 } TransformInstance [2][2];
6066 ${POSITION_FRAG_COLOR} = vec4(1.0);
6073 desc "Testing that compiler doesn't allow arrays of arrays of SSBOs"
6074 expect compile_or_link_fail
6078 precision mediump float;
6081 layout(std430) buffer Transform {
6082 mat4 modelViewMatrix;
6083 mat4 modelViewProjectionMatrix;
6086 } TransformInstance [2][2];
6090 ${POSITION_FRAG_COLOR} = vec4(1.0);