5 int foo(int a, const int b, in int c, const in int d, out int e, inout int f)
\r
7 int sum = a + b + c + d + f; // no e, it is out only
\r
8 // sum should be 47 now
\r
11 // no b, it is read only
\r
13 // no d, it is read only
\r
14 e = 64 * 16; // e starts undefined
\r
17 sum += a + 64 * b + c + 64 * d + e + f; // everything has a value now, totaling of 64(1+2+4+8+16+32) = 64*63 = 4032
\r
18 // sum should be 4032 + 47 = 4079
\r
23 int foo2(float a, vec3 b, out int r)
\r
26 return int(5.0 * b.y);
\r
48 // test the different qualifers
\r
49 int color = foo(1, 2, t+t, 8, e, f.t.y);
\r
51 color += 128 * (e + f.t.y); // right side should be 128(64(16 + 32)) = 393216
\r
52 // sum should be 4079 + 393216 = 397295
\r
57 ret = foo2(4, ivec3(1,2,3), arg); // ret = 10, param = 12.0
\r
58 color += int(ret + arg); // adds 22, for total of 397317
\r
60 color += foo3(); // theoretically, add 2000000, for total of 2397317
\r
62 gl_FragColor = vec4(color);
\r