blob: ca06a752e886d50584c231d48a2ac53786efe230 [file] [log] [blame]
John Kessenich2f21fcc2015-06-17 16:15:09 +00001#version 130
2
3uniform ivec4 uiv4;
4uniform vec4 uv4;
5uniform bool ub;
6uniform bvec4 ub41, ub42;
7uniform float uf;
8uniform int ui;
9
John Kessenich4bfeed52016-01-22 15:40:24 -070010
John Kessenich2f21fcc2015-06-17 16:15:09 +000011uniform uvec4 uuv4;
John Kessenich4bfeed52016-01-22 15:40:24 -070012uniform uint uui;
13
John Kessenich2f21fcc2015-06-17 16:15:09 +000014
15void main()
16{
17 vec4 v;
18 float f;
19 bool b;
20 bvec4 bv4;
21 int i;
John Kessenich4bfeed52016-01-22 15:40:24 -070022
John Kessenich2f21fcc2015-06-17 16:15:09 +000023 uint u;
John Kessenich4bfeed52016-01-22 15:40:24 -070024
John Kessenich2f21fcc2015-06-17 16:15:09 +000025
26 // floating point
27 v = radians(uv4);
28 v += degrees(v);
29 v += (i = ui*ui, sin(v));
30 v += cos(v);
31 v += tan(v);
32 v += asin(v);
33 v += acos(v);
34
35 v += atan(v);
36 v += sinh(v);
37 v += cosh(v);
38 v += tanh(v);
39 v += asinh(v);
40 v += acosh(v);
41 v += atanh(v);
42
43 v += pow(v, v);
44 v += exp(v);
45 v += log(v);
46 v += exp2(v);
47 v += log2(v);
48 v += sqrt(v);
49 v += inversesqrt(v);
50 v += abs(v);
51 v += sign(v);
52 v += floor(v);
53
John Kessenich4bfeed52016-01-22 15:40:24 -070054
John Kessenich2f21fcc2015-06-17 16:15:09 +000055 v += trunc(v);
56 v += round(v);
57 v += roundEven(v);
John Kessenich4bfeed52016-01-22 15:40:24 -070058
John Kessenich2f21fcc2015-06-17 16:15:09 +000059
60 v += ceil(v);
61 v += fract(v);
62 v += mod(v, v);
63 v += mod(v, v.x);
64
John Kessenich4bfeed52016-01-22 15:40:24 -070065
John Kessenich2f21fcc2015-06-17 16:15:09 +000066 v += modf(v, v);
John Kessenich4bfeed52016-01-22 15:40:24 -070067
John Kessenich2f21fcc2015-06-17 16:15:09 +000068
69 v += min(v, uv4);
70 v += max(v, uv4);
71 v += clamp(v, uv4, uv4);
72 v += mix(v,v,v);
73
John Kessenich4bfeed52016-01-22 15:40:24 -070074
75 v += mix(v,v,bv4);
76 v += intBitsToFloat(ivec4(i));
77 v += uintBitsToFloat(uv4);
78 v += fma(v,v,v);
John Kessenich2f21fcc2015-06-17 16:15:09 +000079 v += frexp(v);
80 v += ldexp(v);
81 v += unpackUnorm2x16(v);
82 v += unpackUnorm4x8(v);
83 v += unpackSnorm4x8(v);
John Kessenich4bfeed52016-01-22 15:40:24 -070084
John Kessenich2f21fcc2015-06-17 16:15:09 +000085
86 v += step(v,v);
87 v += smoothstep(v,v,v);
88 v += step(uf,v);
89 v += smoothstep(uf,uf,v);
90 v += normalize(v);
91 v += faceforward(v, v, v);
92 v += reflect(v, v);
93 v += refract(v, v, uf);
94 v += dFdx(v);
95 v += dFdy(v);
96 v += fwidth(v);
97 //noise*(v);
98
John Kessenich4bfeed52016-01-22 15:40:24 -070099
John Kessenich2f21fcc2015-06-17 16:15:09 +0000100 // signed integer
101 i += abs(ui);
102 i += sign(i);
103 i += min(i, ui);
104 i += max(i, ui);
105 i += clamp(i, ui, ui);
106
107 floatsBitsToInt(v);
108 packUnorm2x16(v);
109 packUnorm4x8(v);
110 packSnorm4x8(v);
111
112 // unsigned integer
113 u = abs(uui);
114 u += sign(u);
115 u += min(u, uui);
116 u += max(u, uui);
117 u += clamp(u, uui, uui);
118 u += floatsBitToInt(v);
119 u += packUnorm2x16(v);
120 u += packUnorm4x8(v);
John Kessenich4bfeed52016-01-22 15:40:24 -0700121 i += uui & i; // ERRORs, no int/uint conversions before 400
122 i += uui ^ i;
123 i += i | uui;
John Kessenich2f21fcc2015-06-17 16:15:09 +0000124
125 // bool
John Kessenich4bfeed52016-01-22 15:40:24 -0700126
John Kessenich2f21fcc2015-06-17 16:15:09 +0000127 b = isnan(uf);
John Kessenich4bfeed52016-01-22 15:40:24 -0700128 b = isinf(v.y);
129
John Kessenich2f21fcc2015-06-17 16:15:09 +0000130 b = any(lessThan(v, uv4));
131 b = (b && any(lessThanEqual(v, uv4)));
132 b = (b && any(greaterThan(v, uv4)));
133 b = (b && any(greaterThanEqual(v, uv4)));
134 b = (b && any(equal(ub41, ub42)));
135 b = (b && any(notEqual(ub41, ub42)));
136 b = (b && any(ub41));
137 b = (b && all(ub41));
138 b = (b && any(not(ub41)));
139
140 i = ((i + ui) * i - ui) / i;
141 i = i % ui;
142 if (i == ui || i != ui && i == ui ^^ i != 2)
143 ++i;
144
145 f = ((uf + uf) * uf - uf) / uf;
146
147 f += length(v);
148 f += distance(v, v);
149 f += dot(v, v);
150 f += dot(f, uf);
151 f += cross(v.xyz, v.xyz).x;
152
153 if (f == uf || f != uf && f != 2.0)
154 ++f;
155
156 i &= ui;
157 i |= 0x42;
158 i ^= ui;
159 i %= 17;
160 i >>= 2;
161 i <<= ui;
162 i = ~i;
163 b = !b;
164
165 gl_FragColor = b ? vec4(i) + vec4(f) + v : v;
166}