John Kessenich | f6eae2a | 2016-01-22 17:47:22 -0700 | [diff] [blame] | 1 | #version 140
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 2 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 3 | bool u_b;
|
| 4 | bvec2 u_b2;
|
| 5 | bvec3 u_b3;
|
| 6 | bvec4 u_b4;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 7 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 8 | int u_i;
|
| 9 | ivec2 u_i2;
|
| 10 | ivec3 u_i3;
|
| 11 | ivec4 u_i4;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 12 |
|
John Kessenich | 6c292d3 | 2016-02-15 20:58:50 -0700 | [diff] [blame] | 13 | float u_f;
|
| 14 | vec2 u_f2;
|
| 15 | vec3 u_f3;
|
| 16 | vec4 u_f4;
|
| 17 |
|
| 18 | bool i_b;
|
| 19 | bvec2 i_b2;
|
| 20 | bvec3 i_b3;
|
| 21 | bvec4 i_b4;
|
John Kessenich | 39374da | 2015-05-15 21:32:46 +0000 | [diff] [blame] | 22 |
|
| 23 | flat in int i_i;
|
| 24 | flat in ivec2 i_i2;
|
| 25 | flat in ivec3 i_i3;
|
| 26 | flat in ivec4 i_i4;
|
| 27 |
|
| 28 | in float i_f;
|
| 29 | in vec2 i_f2;
|
| 30 | in vec3 i_f3;
|
| 31 | in vec4 i_f4;
|
| 32 |
|
| 33 | void main()
|
| 34 | {
|
| 35 | bool b = bool(u_i) ^^ bool(u_f);
|
| 36 | bvec2 b2 = bvec2(u_i, u_f);
|
| 37 | bvec3 b3 = bvec3(u_i, u_f, i_i);
|
| 38 | bvec4 b4 = bvec4(u_i, u_f, i_i, i_f);
|
| 39 |
|
| 40 | int i = int(u_f) + int(b);
|
| 41 | ivec2 i2 = ivec2(u_f2) + ivec2(b2);
|
| 42 | ivec3 i3 = ivec3(u_f3) + ivec3(b3);
|
| 43 | ivec4 i4 = ivec4(u_f4) + ivec4(b4);
|
| 44 |
|
| 45 | float f = i;
|
| 46 | vec2 f2 = i2;
|
| 47 | vec3 f3 = i3;
|
| 48 | vec4 f4 = i4;
|
| 49 |
|
| 50 | f += (float(i) + float(b));
|
| 51 | f2 -= vec2(i2) + vec2(b2);
|
| 52 | f3 /= vec3(i3) + vec3(b3);
|
| 53 | f4 += vec4(i4) + vec4(b4);
|
| 54 |
|
| 55 | f4 += vec4(bvec4(i_i4));
|
| 56 | f4 += vec4(bvec4(u_f4));
|
| 57 |
|
| 58 | f += f - i;
|
| 59 | f2 += vec2(f, i) + i2;
|
| 60 | f3 += i3 + vec3(f, i, f);
|
| 61 | f4 += vec4(b, i, f, i) + i4;
|
| 62 |
|
| 63 | f2 += vec2(f, i) * i;
|
| 64 | f3 += vec3(f, i, f) + i;
|
| 65 | f4 += i - vec4(b, i, f, i);
|
| 66 |
|
| 67 | i2 += ivec2(f, i);
|
| 68 | i3 += ivec3(f, i, f);
|
| 69 | i4 += ivec4(b, i, f, i);
|
| 70 |
|
| 71 | if (f < i || i < f ||
|
| 72 | f2 == i2 ||
|
| 73 | i3 != f3)
|
| 74 | f = (b ? i : f2.x) + (b2.x ? f3.x : i2.y);
|
| 75 |
|
| 76 | gl_FragColor =
|
| 77 | b ||
|
| 78 | b2.x ||
|
| 79 | b2.y ||
|
| 80 | b3.x ||
|
| 81 | b3.y ||
|
| 82 | b3.z ||
|
| 83 | b4.x ||
|
| 84 | b4.y ||
|
| 85 | b4.z ||
|
| 86 | b4.w ? vec4(
|
| 87 | i +
|
| 88 | i2.x +
|
| 89 | i2.y +
|
| 90 | i3.x +
|
| 91 | i3.y +
|
| 92 | i3.z +
|
| 93 | i4.x +
|
| 94 | i4.y +
|
| 95 | i4.z +
|
| 96 | i4.w +
|
| 97 | f +
|
| 98 | f2.x +
|
| 99 | f2.y +
|
| 100 | f3.x +
|
| 101 | f3.y +
|
| 102 | f3.z +
|
| 103 | f4.x +
|
| 104 | f4.y +
|
| 105 | f4.z +
|
| 106 | f4.w) : vec4(1.0);
|
| 107 |
|
| 108 | // with constants...
|
| 109 | ivec4 cv2 = ivec4(1.0);
|
| 110 | bvec4 cv5 = bvec4(cv2);
|
| 111 | gl_FragColor += float(cv5);
|
| 112 | }
|