]> git.tdb.fi Git - libs/gl.git/blob - builtin_data/_builtin.glsl
157e05a792bc658cca519e1c6154062db734267d
[libs/gl.git] / builtin_data / _builtin.glsl
1 typedef vector(2) float vec2;
2 typedef vector(3) float vec3;
3 typedef vector(4) float vec4;
4 typedef vector(2) vec2 mat2;
5 typedef mat2 mat2x2;
6 typedef vector(3) vec2 mat3x2;
7 typedef vector(4) vec2 mat4x2;
8 typedef vector(2) vec3 mat2x3;
9 typedef vector(3) vec3 mat3;
10 typedef mat3 mat3x3;
11 typedef vector(4) vec3 mat4x3;
12 typedef vector(2) vec4 mat2x4;
13 typedef vector(3) vec4 mat3x4;
14 typedef vector(4) vec4 mat4;
15 typedef mat4 mat4x4;
16
17 typedef vector(2) int ivec2;
18 typedef vector(3) int ivec3;
19 typedef vector(4) int ivec4;
20
21 typedef vector(2) uint uvec2;
22 typedef vector(3) uint uvec3;
23 typedef vector(4) uint uvec4;
24
25 typedef vector(2) bool bvec2;
26 typedef vector(3) bool bvec3;
27 typedef vector(4) bool bvec4;
28
29 typedef image(dimensions=1, sampled) float sampler1D;
30 typedef image(dimensions=2, sampled) float sampler2D;
31 typedef image(dimensions=3, sampled) float sampler3D;
32 typedef image(dimensions=cube, sampled) float samplerCube;
33 typedef image(dimensions=1[], sampled) float sampler1DArray;
34 typedef image(dimensions=2[], sampled) float sampler2DArray;
35 typedef image(dimensions=cube[], sampled) float samplerCubeArray;
36 typedef image(dimensions=1, shadow, sampled) float sampler1DShadow;
37 typedef image(dimensions=2, shadow, sampled) float sampler2DShadow;
38 typedef image(dimensions=1[], shadow, sampled) float sampler1DArrayShadow;
39 typedef image(dimensions=2[], shadow, sampled) float sampler2DArrayShadow;
40 typedef image(dimensions=cube, shadow, sampled) float samplerCubeShadow;
41 typedef image(dimensions=cube[], shadow, sampled) float samplerCubeArrayShadow;
42 typedef image(dimensions=2, sampled, multisample) float sampler2DMS;
43 typedef image(dimensions=2[], sampled, multisample) float sampler2DMSArray;
44 typedef image(dimensions=1) float image1D;
45 typedef image(dimensions=2) float image2D;
46 typedef image(dimensions=3) float image3D;
47 typedef image(dimensions=cube) float imageCube;
48 typedef image(dimensions=1[]) float image1DArray;
49 typedef image(dimensions=2[]) float image2DArray;
50 typedef image(dimensions=cube[]) float imageCubeArray;
51 typedef image(dimensions=2, multisample) float image2DMS;
52 typedef image(dimensions=2[], multisample) float image2DMSArray;
53
54 const float PI = 3.1415926535;
55
56 // BEGIN BUILTIN FUNCTIONS
57 float radians(float degrees);
58 vec2 radians(vec2 degrees);
59 vec3 radians(vec3 degrees);
60 vec4 radians(vec4 degrees);
61 float degrees(float radians);
62 vec2 degrees(vec2 radians);
63 vec3 degrees(vec3 radians);
64 vec4 degrees(vec4 radians);
65 float sin(float angle);
66 vec2 sin(vec2 angle);
67 vec3 sin(vec3 angle);
68 vec4 sin(vec4 angle);
69 float cos(float angle);
70 vec2 cos(vec2 angle);
71 vec3 cos(vec3 angle);
72 vec4 cos(vec4 angle);
73 float tan(float angle);
74 vec2 tan(vec2 angle);
75 vec3 tan(vec3 angle);
76 vec4 tan(vec4 angle);
77 float asin(float x);
78 vec2 asin(vec2 x);
79 vec3 asin(vec3 x);
80 vec4 asin(vec4 x);
81 float acos(float x);
82 vec2 acos(vec2 x);
83 vec3 acos(vec3 x);
84 vec4 acos(vec4 x);
85 float atan(float y, float x);
86 vec2 atan(vec2 y, vec2 x);
87 vec3 atan(vec3 y, vec3 x);
88 vec4 atan(vec4 y, vec4 x);
89 float atan(float y_over_x);
90 vec2 atan(vec2 y_over_x);
91 vec3 atan(vec3 y_over_x);
92 vec4 atan(vec4 y_over_x);
93 float sinh(float angle);
94 vec2 sinh(vec2 angle);
95 vec3 sinh(vec3 angle);
96 vec4 sinh(vec4 angle);
97 float cosh(float angle);
98 vec2 cosh(vec2 angle);
99 vec3 cosh(vec3 angle);
100 vec4 cosh(vec4 angle);
101 float tanh(float angle);
102 vec2 tanh(vec2 angle);
103 vec3 tanh(vec3 angle);
104 vec4 tanh(vec4 angle);
105 float asinh(float x);
106 vec2 asinh(vec2 x);
107 vec3 asinh(vec3 x);
108 vec4 asinh(vec4 x);
109 float acosh(float x);
110 vec2 acosh(vec2 x);
111 vec3 acosh(vec3 x);
112 vec4 acosh(vec4 x);
113 float atanh(float x);
114 vec2 atanh(vec2 x);
115 vec3 atanh(vec3 x);
116 vec4 atanh(vec4 x);
117 float pow(float x, float y);
118 vec2 pow(vec2 x, vec2 y);
119 vec3 pow(vec3 x, vec3 y);
120 vec4 pow(vec4 x, vec4 y);
121 float exp(float x);
122 vec2 exp(vec2 x);
123 vec3 exp(vec3 x);
124 vec4 exp(vec4 x);
125 float log(float x);
126 vec2 log(vec2 x);
127 vec3 log(vec3 x);
128 vec4 log(vec4 x);
129 float exp2(float x);
130 vec2 exp2(vec2 x);
131 vec3 exp2(vec3 x);
132 vec4 exp2(vec4 x);
133 float log2(float x);
134 vec2 log2(vec2 x);
135 vec3 log2(vec3 x);
136 vec4 log2(vec4 x);
137 float sqrt(float x);
138 vec2 sqrt(vec2 x);
139 vec3 sqrt(vec3 x);
140 vec4 sqrt(vec4 x);
141 float inversesqrt(float x);
142 vec2 inversesqrt(vec2 x);
143 vec3 inversesqrt(vec3 x);
144 vec4 inversesqrt(vec4 x);
145 float abs(float x);
146 vec2 abs(vec2 x);
147 vec3 abs(vec3 x);
148 vec4 abs(vec4 x);
149 int abs(int x);
150 ivec2 abs(ivec2 x);
151 ivec3 abs(ivec3 x);
152 ivec4 abs(ivec4 x);
153 float sign(float x);
154 vec2 sign(vec2 x);
155 vec3 sign(vec3 x);
156 vec4 sign(vec4 x);
157 int sign(int x);
158 ivec2 sign(ivec2 x);
159 ivec3 sign(ivec3 x);
160 ivec4 sign(ivec4 x);
161 float floor(float x);
162 vec2 floor(vec2 x);
163 vec3 floor(vec3 x);
164 vec4 floor(vec4 x);
165 float trunc(float x);
166 vec2 trunc(vec2 x);
167 vec3 trunc(vec3 x);
168 vec4 trunc(vec4 x);
169 float round(float x);
170 vec2 round(vec2 x);
171 vec3 round(vec3 x);
172 vec4 round(vec4 x);
173 float roundEven(float x);
174 vec2 roundEven(vec2 x);
175 vec3 roundEven(vec3 x);
176 vec4 roundEven(vec4 x);
177 float ceil(float x);
178 vec2 ceil(vec2 x);
179 vec3 ceil(vec3 x);
180 vec4 ceil(vec4 x);
181 float fract(float x);
182 vec2 fract(vec2 x);
183 vec3 fract(vec3 x);
184 vec4 fract(vec4 x);
185 float mod(float x, float y);
186 vec2 mod(vec2 x, vec2 y);
187 vec3 mod(vec3 x, vec3 y);
188 vec4 mod(vec4 x, vec4 y);
189 vec2 mod(vec2 x, float y) { return mod(x, vec2(y)); }
190 vec3 mod(vec3 x, float y) { return mod(x, vec3(y)); }
191 vec4 mod(vec4 x, float y) { return mod(x, vec4(y)); }
192 float min(float x, float y);
193 vec2 min(vec2 x, vec2 y);
194 vec3 min(vec3 x, vec3 y);
195 vec4 min(vec4 x, vec4 y);
196 int min(int x, int y);
197 ivec2 min(ivec2 x, ivec2 y);
198 ivec3 min(ivec3 x, ivec3 y);
199 ivec4 min(ivec4 x, ivec4 y);
200 uint min(uint x, uint y);
201 uvec2 min(uvec2 x, uvec2 y);
202 uvec3 min(uvec3 x, uvec3 y);
203 uvec4 min(uvec4 x, uvec4 y);
204 vec2 min(vec2 x, float y) { return min(x, vec2(y)); }
205 vec3 min(vec3 x, float y) { return min(x, vec3(y)); }
206 vec4 min(vec4 x, float y) { return min(x, vec4(y)); }
207 ivec2 min(ivec2 x, int y) { return min(x, ivec2(y)); }
208 ivec3 min(ivec3 x, int y) { return min(x, ivec3(y)); }
209 ivec4 min(ivec4 x, int y) { return min(x, ivec4(y)); }
210 uvec2 min(uvec2 x, uint y) { return min(x, uvec2(y)); }
211 uvec3 min(uvec3 x, uint y) { return min(x, uvec3(y)); }
212 uvec4 min(uvec4 x, uint y) { return min(x, uvec4(y)); }
213 float max(float x, float y);
214 vec2 max(vec2 x, vec2 y);
215 vec3 max(vec3 x, vec3 y);
216 vec4 max(vec4 x, vec4 y);
217 int max(int x, int y);
218 ivec2 max(ivec2 x, ivec2 y);
219 ivec3 max(ivec3 x, ivec3 y);
220 ivec4 max(ivec4 x, ivec4 y);
221 uint max(uint x, uint y);
222 uvec2 max(uvec2 x, uvec2 y);
223 uvec3 max(uvec3 x, uvec3 y);
224 uvec4 max(uvec4 x, uvec4 y);
225 vec2 max(vec2 x, float y) { return max(x, vec2(y)); }
226 vec3 max(vec3 x, float y) { return max(x, vec3(y)); }
227 vec4 max(vec4 x, float y) { return max(x, vec4(y)); }
228 ivec2 max(ivec2 x, int y) { return max(x, ivec2(y)); }
229 ivec3 max(ivec3 x, int y) { return max(x, ivec3(y)); }
230 ivec4 max(ivec4 x, int y) { return max(x, ivec4(y)); }
231 uvec2 max(uvec2 x, uint y) { return max(x, uvec2(y)); }
232 uvec3 max(uvec3 x, uint y) { return max(x, uvec3(y)); }
233 uvec4 max(uvec4 x, uint y) { return max(x, uvec4(y)); }
234 float clamp(float x, float minVal, float maxVal);
235 vec2 clamp(vec2 x, vec2 minVal, vec2 maxVal);
236 vec3 clamp(vec3 x, vec3 minVal, vec3 maxVal);
237 vec4 clamp(vec4 x, vec4 minVal, vec4 maxVal);
238 int clamp(int x, int minVal, int maxVal);
239 ivec2 clamp(ivec2 x, ivec2 minVal, ivec2 maxVal);
240 ivec3 clamp(ivec3 x, ivec3 minVal, ivec3 maxVal);
241 ivec4 clamp(ivec4 x, ivec4 minVal, ivec4 maxVal);
242 uint clamp(uint x, uint minVal, uint maxVal);
243 uvec2 clamp(uvec2 x, uvec2 minVal, uvec2 maxVal);
244 uvec3 clamp(uvec3 x, uvec3 minVal, uvec3 maxVal);
245 uvec4 clamp(uvec4 x, uvec4 minVal, uvec4 maxVal);
246 vec2 clamp(vec2 x, float minVal, float maxVal) { return clamp(x, vec2(minVal), vec2(maxVal)); }
247 vec3 clamp(vec3 x, float minVal, float maxVal) { return clamp(x, vec3(minVal), vec3(maxVal)); }
248 vec4 clamp(vec4 x, float minVal, float maxVal) { return clamp(x, vec4(minVal), vec4(maxVal)); }
249 ivec2 clamp(ivec2 x, int minVal, int maxVal) { return clamp(x, ivec2(minVal), ivec2(maxVal)); }
250 ivec3 clamp(ivec3 x, int minVal, int maxVal) { return clamp(x, ivec3(minVal), ivec3(maxVal)); }
251 ivec4 clamp(ivec4 x, int minVal, int maxVal) { return clamp(x, ivec4(minVal), ivec4(maxVal)); }
252 uvec2 clamp(uvec2 x, uint minVal, uint maxVal) { return clamp(x, uvec2(minVal), uvec2(maxVal)); }
253 uvec3 clamp(uvec3 x, uint minVal, uint maxVal) { return clamp(x, uvec3(minVal), uvec3(maxVal)); }
254 uvec4 clamp(uvec4 x, uint minVal, uint maxVal) { return clamp(x, uvec4(minVal), uvec4(maxVal)); }
255 float mix(float x, float y, float a);
256 vec2 mix(vec2 x, vec2 y, vec2 a);
257 vec3 mix(vec3 x, vec3 y, vec3 a);
258 vec4 mix(vec4 x, vec4 y, vec4 a);
259 float mix(float x, float y, float a) { return mix(x, y, float(a)); }
260 vec2 mix(vec2 x, vec2 y, float a) { return mix(x, y, vec2(a)); }
261 vec3 mix(vec3 x, vec3 y, float a) { return mix(x, y, vec3(a)); }
262 vec4 mix(vec4 x, vec4 y, float a) { return mix(x, y, vec4(a)); }
263 float mix(float x, float y, bool a);
264 vec2 mix(vec2 x, vec2 y, bvec2 a);
265 vec3 mix(vec3 x, vec3 y, bvec3 a);
266 vec4 mix(vec4 x, vec4 y, bvec4 a);
267 int mix(int x, int y, bool a);
268 ivec2 mix(ivec2 x, ivec2 y, bvec2 a);
269 ivec3 mix(ivec3 x, ivec3 y, bvec3 a);
270 ivec4 mix(ivec4 x, ivec4 y, bvec4 a);
271 uint mix(uint x, uint y, bool a);
272 uvec2 mix(uvec2 x, uvec2 y, bvec2 a);
273 uvec3 mix(uvec3 x, uvec3 y, bvec3 a);
274 uvec4 mix(uvec4 x, uvec4 y, bvec4 a);
275 float step(float edge, float x);
276 vec2 step(vec2 edge, vec2 x);
277 vec3 step(vec3 edge, vec3 x);
278 vec4 step(vec4 edge, vec4 x);
279 vec2 step(float edge, vec2 x) { return step(vec2(edge), x); }
280 vec3 step(float edge, vec3 x) { return step(vec3(edge), x); }
281 vec4 step(float edge, vec4 x) { return step(vec4(edge), x); }
282 float smoothstep(float edge0, float edge1, float x);
283 vec2 smoothstep(vec2 edge0, vec2 edge1, vec2 x);
284 vec3 smoothstep(vec3 edge0, vec3 edge1, vec3 x);
285 vec4 smoothstep(vec4 edge0, vec4 edge1, vec4 x);
286 vec2 smoothstep(float edge0, float edge1, vec2 x) { return smoothstep(vec2(edge0), vec2(edge1), x); }
287 vec3 smoothstep(float edge0, float edge1, vec3 x) { return smoothstep(vec3(edge0), vec3(edge1), x); }
288 vec4 smoothstep(float edge0, float edge1, vec4 x) { return smoothstep(vec4(edge0), vec4(edge1), x); }
289 bool isnan(float x);
290 bvec2 isnan(vec2 x);
291 bvec3 isnan(vec3 x);
292 bvec4 isnan(vec4 x);
293 bool isinf(float x);
294 bvec2 isinf(vec2 x);
295 bvec3 isinf(vec3 x);
296 bvec4 isinf(vec4 x);
297 float fma(float a, float b, float c);
298 vec2 fma(vec2 a, vec2 b, vec2 c);
299 vec3 fma(vec3 a, vec3 b, vec3 c);
300 vec4 fma(vec4 a, vec4 b, vec4 c);
301 float length(float x);
302 float length(vec2 x);
303 float length(vec3 x);
304 float length(vec4 x);
305 float distance(float p0, float p1);
306 float distance(vec2 p0, vec2 p1);
307 float distance(vec3 p0, vec3 p1);
308 float distance(vec4 p0, vec4 p1);
309 float dot(float x, float y);
310 float dot(vec2 x, vec2 y);
311 float dot(vec3 x, vec3 y);
312 float dot(vec4 x, vec4 y);
313 vec3 cross(vec3 x, vec3 y);
314 float normalize(float x);
315 vec2 normalize(vec2 x);
316 vec3 normalize(vec3 x);
317 vec4 normalize(vec4 x);
318 float faceforward(float N, float I, float Nref);
319 vec2 faceforward(vec2 N, vec2 I, vec2 Nref);
320 vec3 faceforward(vec3 N, vec3 I, vec3 Nref);
321 vec4 faceforward(vec4 N, vec4 I, vec4 Nref);
322 float reflect(float I, float N);
323 vec2 reflect(vec2 I, vec2 N);
324 vec3 reflect(vec3 I, vec3 N);
325 vec4 reflect(vec4 I, vec4 N);
326 float refract(float I, float N, float eta);
327 vec2 refract(vec2 I, vec2 N, float eta);
328 vec3 refract(vec3 I, vec3 N, float eta);
329 vec4 refract(vec4 I, vec4 N, float eta);
330 mat2 matrixCompMult(mat2 x, mat2 y);
331 mat3 matrixCompMult(mat3 x, mat3 y);
332 mat4 matrixCompMult(mat4 x, mat4 y);
333 mat2x3 matrixCompMult(mat2x3 x, mat2x3 y);
334 mat3x2 matrixCompMult(mat3x2 x, mat3x2 y);
335 mat2x4 matrixCompMult(mat2x4 x, mat2x4 y);
336 mat4x2 matrixCompMult(mat4x2 x, mat4x2 y);
337 mat3x4 matrixCompMult(mat3x4 x, mat3x4 y);
338 mat4x3 matrixCompMult(mat4x3 x, mat4x3 y);
339 mat2 outerProduct(vec2 c, vec2 r);
340 mat3 outerProduct(vec3 c, vec3 r);
341 mat4 outerProduct(vec4 c, vec4 r);
342 mat2x3 outerProduct(vec3 c, vec2 r);
343 mat3x2 outerProduct(vec2 c, vec3 r);
344 mat2x4 outerProduct(vec4 c, vec2 r);
345 mat4x2 outerProduct(vec2 c, vec4 r);
346 mat3x4 outerProduct(vec4 c, vec3 r);
347 mat4x3 outerProduct(vec3 c, vec4 r);
348 mat2 transpose(mat2 m);
349 mat3 transpose(mat3 m);
350 mat4 transpose(mat4 m);
351 mat3x2 transpose(mat2x3 m);
352 mat2x3 transpose(mat3x2 m);
353 mat4x2 transpose(mat2x4 m);
354 mat2x4 transpose(mat4x2 m);
355 mat4x3 transpose(mat3x4 m);
356 mat3x4 transpose(mat4x3 m);
357 mat2 determinant(mat2 m);
358 mat3 determinant(mat3 m);
359 mat4 determinant(mat4 m);
360 mat2 inverse(mat2 m);
361 mat3 inverse(mat3 m);
362 mat4 inverse(mat4 m);
363 bvec2 lessThan(vec2 x, vec2 y);
364 bvec3 lessThan(vec3 x, vec3 y);
365 bvec4 lessThan(vec4 x, vec4 y);
366 bvec2 lessThan(ivec2 x, ivec2 y);
367 bvec3 lessThan(ivec3 x, ivec3 y);
368 bvec4 lessThan(ivec4 x, ivec4 y);
369 bvec2 lessThan(uvec2 x, uvec2 y);
370 bvec3 lessThan(uvec3 x, uvec3 y);
371 bvec4 lessThan(uvec4 x, uvec4 y);
372 bvec2 lessThanEqual(vec2 x, vec2 y);
373 bvec3 lessThanEqual(vec3 x, vec3 y);
374 bvec4 lessThanEqual(vec4 x, vec4 y);
375 bvec2 lessThanEqual(ivec2 x, ivec2 y);
376 bvec3 lessThanEqual(ivec3 x, ivec3 y);
377 bvec4 lessThanEqual(ivec4 x, ivec4 y);
378 bvec2 lessThanEqual(uvec2 x, uvec2 y);
379 bvec3 lessThanEqual(uvec3 x, uvec3 y);
380 bvec4 lessThanEqual(uvec4 x, uvec4 y);
381 bvec2 greaterThan(vec2 x, vec2 y);
382 bvec3 greaterThan(vec3 x, vec3 y);
383 bvec4 greaterThan(vec4 x, vec4 y);
384 bvec2 greaterThan(ivec2 x, ivec2 y);
385 bvec3 greaterThan(ivec3 x, ivec3 y);
386 bvec4 greaterThan(ivec4 x, ivec4 y);
387 bvec2 greaterThan(uvec2 x, uvec2 y);
388 bvec3 greaterThan(uvec3 x, uvec3 y);
389 bvec4 greaterThan(uvec4 x, uvec4 y);
390 bvec2 greaterThanEqual(vec2 x, vec2 y);
391 bvec3 greaterThanEqual(vec3 x, vec3 y);
392 bvec4 greaterThanEqual(vec4 x, vec4 y);
393 bvec2 greaterThanEqual(ivec2 x, ivec2 y);
394 bvec3 greaterThanEqual(ivec3 x, ivec3 y);
395 bvec4 greaterThanEqual(ivec4 x, ivec4 y);
396 bvec2 greaterThanEqual(uvec2 x, uvec2 y);
397 bvec3 greaterThanEqual(uvec3 x, uvec3 y);
398 bvec4 greaterThanEqual(uvec4 x, uvec4 y);
399 bvec2 equal(vec2 x, vec2 y);
400 bvec3 equal(vec3 x, vec3 y);
401 bvec4 equal(vec4 x, vec4 y);
402 bvec2 equal(ivec2 x, ivec2 y);
403 bvec3 equal(ivec3 x, ivec3 y);
404 bvec4 equal(ivec4 x, ivec4 y);
405 bvec2 equal(uvec2 x, uvec2 y);
406 bvec3 equal(uvec3 x, uvec3 y);
407 bvec4 equal(uvec4 x, uvec4 y);
408 bvec2 notEqual(vec2 x, vec2 y);
409 bvec3 notEqual(vec3 x, vec3 y);
410 bvec4 notEqual(vec4 x, vec4 y);
411 bvec2 notEqual(ivec2 x, ivec2 y);
412 bvec3 notEqual(ivec3 x, ivec3 y);
413 bvec4 notEqual(ivec4 x, ivec4 y);
414 bvec2 notEqual(uvec2 x, uvec2 y);
415 bvec3 notEqual(uvec3 x, uvec3 y);
416 bvec4 notEqual(uvec4 x, uvec4 y);
417 bool any(bvec2 x);
418 bool any(bvec3 x);
419 bool any(bvec4 x);
420 bool all(bvec2 x);
421 bool all(bvec3 x);
422 bool all(bvec4 x);
423 bool not(bvec2 x);
424 bool not(bvec3 x);
425 bool not(bvec4 x);
426 int bitfieldExtract(int value, int offset, int bits);
427 ivec2 bitfieldExtract(ivec2 value, int offset, int bits);
428 ivec3 bitfieldExtract(ivec3 value, int offset, int bits);
429 ivec4 bitfieldExtract(ivec4 value, int offset, int bits);
430 uint bitfieldExtract(uint value, int offset, int bits);
431 uvec2 bitfieldExtract(uvec2 value, int offset, int bits);
432 uvec3 bitfieldExtract(uvec3 value, int offset, int bits);
433 uvec4 bitfieldExtract(uvec4 value, int offset, int bits);
434 int bitfieldInsert(int value, int insert, int offset, int bits);
435 ivec2 bitfieldInsert(ivec2 value, ivec2 insert, int offset, int bits);
436 ivec3 bitfieldInsert(ivec3 value, ivec3 insert, int offset, int bits);
437 ivec4 bitfieldInsert(ivec4 value, ivec4 insert, int offset, int bits);
438 uint bitfieldInsert(uint value, uint insert, int offset, int bits);
439 uvec2 bitfieldInsert(uvec2 value, uvec2 insert, int offset, int bits);
440 uvec3 bitfieldInsert(uvec3 value, uvec3 insert, int offset, int bits);
441 uvec4 bitfieldInsert(uvec4 value, uvec4 insert, int offset, int bits);
442 int bitfieldReverse(int value);
443 ivec2 bitfieldReverse(ivec2 value);
444 ivec3 bitfieldReverse(ivec3 value);
445 ivec4 bitfieldReverse(ivec4 value);
446 uint bitfieldReverse(uint value);
447 uvec2 bitfieldReverse(uvec2 value);
448 uvec3 bitfieldReverse(uvec3 value);
449 uvec4 bitfieldReverse(uvec4 value);
450 int bitCount(int value);
451 ivec2 bitCount(ivec2 value);
452 ivec3 bitCount(ivec3 value);
453 ivec4 bitCount(ivec4 value);
454 uint bitCount(uint value);
455 uvec2 bitCount(uvec2 value);
456 uvec3 bitCount(uvec3 value);
457 uvec4 bitCount(uvec4 value);
458 int findLSB(int value);
459 ivec2 findLSB(ivec2 value);
460 ivec3 findLSB(ivec3 value);
461 ivec4 findLSB(ivec4 value);
462 int findLSB(uint value);
463 ivec2 findLSB(uvec2 value);
464 ivec3 findLSB(uvec3 value);
465 ivec4 findLSB(uvec4 value);
466 int findMSB(int value);
467 ivec2 findMSB(ivec2 value);
468 ivec3 findMSB(ivec3 value);
469 ivec4 findMSB(ivec4 value);
470 int findMSB(uint value);
471 ivec2 findMSB(uvec2 value);
472 ivec3 findMSB(uvec3 value);
473 ivec4 findMSB(uvec4 value);
474 int textureSize(sampler1D sampler, int lod);
475 ivec2 textureSize(sampler2D sampler, int lod);
476 ivec3 textureSize(sampler3D sampler, int lod);
477 ivec2 textureSize(sampler1DArray sampler, int lod);
478 ivec3 textureSize(sampler2DArray sampler, int lod);
479 ivec2 textureSize(samplerCube sampler, int lod);
480 ivec3 textureSize(samplerCubeArray sampler, int lod);
481 int textureSize(sampler1DShadow sampler, int lod);
482 ivec2 textureSize(sampler2DShadow sampler, int lod);
483 ivec2 textureSize(samplerCubeShadow sampler, int lod);
484 ivec2 textureSize(sampler1DArrayShadow sampler, int lod);
485 ivec3 textureSize(sampler2DArrayShadow sampler, int lod);
486 ivec3 textureSize(samplerCubeArrayShadow sampler, int lod);
487 ivec2 textureSize(sampler2DMS sampler, int lod);
488 ivec3 textureSize(sampler2DMSArray sampler, int lod);
489 vec2 textureQueryLod(sampler1D sampler, float P);
490 vec2 textureQueryLod(sampler2D sampler, vec2 P);
491 vec2 textureQueryLod(sampler3D sampler, vec3 P);
492 vec2 textureQueryLod(sampler1DArray sampler, float P);
493 vec2 textureQueryLod(sampler2DArray sampler, vec2 P);
494 vec2 textureQueryLod(samplerCube sampler, vec3 P);
495 vec2 textureQueryLod(samplerCubeArray sampler, vec3 P);
496 vec2 textureQueryLod(sampler1DShadow sampler, float P);
497 vec2 textureQueryLod(sampler2DShadow sampler, vec2 P);
498 vec2 textureQueryLod(samplerCubeShadow sampler, vec3 P);
499 vec2 textureQueryLod(sampler1DArrayShadow sampler, float P);
500 vec2 textureQueryLod(sampler2DArrayShadow sampler, vec2 P);
501 vec2 textureQueryLod(samplerCubeArrayShadow sampler, vec3 P);
502 int textureQueryLevels(sampler1D sampler);
503 int textureQueryLevels(sampler2D sampler);
504 int textureQueryLevels(sampler3D sampler);
505 int textureQueryLevels(sampler1DArray sampler);
506 int textureQueryLevels(sampler2DArray sampler);
507 int textureQueryLevels(samplerCube sampler);
508 int textureQueryLevels(samplerCubeArray sampler);
509 int textureQueryLevels(sampler1DShadow sampler);
510 int textureQueryLevels(sampler2DShadow sampler);
511 int textureQueryLevels(samplerCubeShadow sampler);
512 int textureQueryLevels(sampler1DArrayShadow sampler);
513 int textureQueryLevels(sampler2DArrayShadow sampler);
514 int textureQueryLevels(samplerCubeArrayShadow sampler);
515 int textureSamples(sampler2DMS sampler);
516 int textureSamples(sampler2DMSArray sampler);
517 vec4 texture(sampler1D sampler, float P);
518 vec4 texture(sampler2D sampler, vec2 P);
519 vec4 texture(sampler3D sampler, vec3 P);
520 vec4 texture(sampler1DArray sampler, vec2 P);
521 vec4 texture(sampler2DArray sampler, vec3 P);
522 vec4 texture(samplerCube sampler, vec3 P);
523 vec4 texture(samplerCubeArray sampler, vec4 P);
524 float texture(sampler1DShadow sampler, vec3 P);
525 float texture(sampler2DShadow sampler, vec3 P);
526 float texture(samplerCubeShadow sampler, vec4 P);
527 float texture(sampler1DArrayShadow sampler, vec3 P);
528 float texture(sampler2DArrayShadow sampler, vec4 P);
529 float texture(samplerCubeArrayShadow sampler, vec4 P, float compare);
530 vec4 textureLod(sampler1D sampler, float P, float lod);
531 vec4 textureLod(sampler2D sampler, vec2 P, float lod);
532 vec4 textureLod(sampler3D sampler, vec3 P, float lod);
533 vec4 textureLod(sampler1DArray sampler, vec2 P, float lod);
534 vec4 textureLod(sampler2DArray sampler, vec3 P, float lod);
535 vec4 textureLod(samplerCube sampler, vec3 P, float lod);
536 vec4 textureLod(samplerCubeArray sampler, vec4 P, float lod);
537 vec4 texelFetch(sampler1D sampler, int P, int lod);
538 vec4 texelFetch(sampler2D sampler, ivec2 P, int lod);
539 vec4 texelFetch(sampler3D sampler, ivec3 P, int lod);
540 vec4 texelFetch(sampler1DArray sampler, ivec2 P, int lod);
541 vec4 texelFetch(sampler2DArray sampler, ivec3 P, int lod);
542 vec4 texelFetch(sampler2DMS sampler, ivec2 P, int sample);
543 vec4 texelFetch(sampler2DMSArray sampler, ivec3 P, int sample);
544 int imageSize(image1D image);
545 ivec2 imageSize(image2D image);
546 ivec3 imageSize(image3D image);
547 ivec2 imageSize(image1DArray image);
548 ivec3 imageSize(image2DArray image);
549 ivec2 imageSize(imageCube image);
550 ivec3 imageSize(imageCubeArray image);
551 ivec2 imageSize(image2DMS image);
552 ivec3 imageSize(image2DMSArray image);
553 int imageSamples(image2DMS image);
554 int imageSamples(image2DMSArray image);
555 vec4 imageLoad(image1D image, int P);
556 vec4 imageLoad(image2D image, ivec2 P);
557 vec4 imageLoad(image3D image, ivec3 P);
558 vec4 imageLoad(image1DArray image, ivec2 P);
559 vec4 imageLoad(image2DArray image, ivec3 P);
560 vec4 imageLoad(imageCube image, ivec3 P);
561 vec4 imageLoad(imageCubeArray image, ivec4 P);
562 vec4 imageLoad(image2DMS image, ivec2 P, int sample);
563 vec4 imageLoad(image2DMSArray image, ivec3 P, int sample);
564 void imageStore(image1D image, int P, vec4 data);
565 void imageStore(image2D image, ivec2 P, vec4 data);
566 void imageStore(image3D image, ivec3 P, vec4 data);
567 void imageStore(image1DArray image, ivec2 P, vec4 data);
568 void imageStore(image2DArray image, ivec3 P, vec4 data);
569 void imageStore(imageCube image, ivec3 P, vec4 data);
570 void imageStore(imageCubeArray image, ivec4 P, vec4 data);
571 void imageStore(image2DMS image, ivec2 P, int sample, vec4 data);
572 void imageStore(image2DMSArray image, ivec3 P, int sample, vec4 data);
573 // END BUILTIN FUNCTIONS
574
575 #pragma MSP stage(vertex)
576 in int gl_VertexID;
577 in int gl_InstanceID;
578 out gl_PerVertex
579 {
580   vec4 gl_Position;
581   float gl_PointSize;
582   float gl_ClipDistance[];
583 };
584
585 #pragma MSP stage(geometry)
586 in gl_PerVertex
587 {
588   vec4 gl_Position;
589   float gl_PointSize;
590   float gl_ClipDistance[];
591 } gl_in[];
592 in int gl_PrimitiveIDIn;
593 in int gl_InvocationID;
594 out gl_PerVertex
595 {
596   vec4 gl_Position;
597   float gl_PointSize;
598   float gl_ClipDistance[];
599 };
600 out int gl_PrimitiveID;
601 out int gl_Layer;
602
603 void EmitVertex();
604 void EndPrimitive();
605
606 #pragma MSP stage(fragment)
607 // BEGIN BUILTIN FRAGMENT FUNCTIONS
608 float dFdx(float p);
609 vec2 dFdx(vec2 p);
610 vec3 dFdx(vec3 p);
611 vec4 dFdx(vec4 p);
612 float dFdy(float p);
613 vec2 dFdy(vec2 p);
614 vec3 dFdy(vec3 p);
615 vec4 dFdy(vec4 p);
616 float dFdxFine(float p);
617 vec2 dFdxFine(vec2 p);
618 vec3 dFdxFine(vec3 p);
619 vec4 dFdxFine(vec4 p);
620 float dFdyFine(float p);
621 vec2 dFdyFine(vec2 p);
622 vec3 dFdyFine(vec3 p);
623 vec4 dFdyFine(vec4 p);
624 float dFdxCoarse(float p);
625 vec2 dFdxCoarse(vec2 p);
626 vec3 dFdxCoarse(vec3 p);
627 vec4 dFdxCoarse(vec4 p);
628 float dFdyCoarse(float p);
629 vec2 dFdyCoarse(vec2 p);
630 vec3 dFdyCoarse(vec3 p);
631 vec4 dFdyCoarse(vec4 p);
632 float fwidth(float p);
633 vec2 fwidth(vec2 p);
634 vec3 fwidth(vec3 p);
635 vec4 fwidth(vec4 p);
636 float fwidthFine(float p);
637 vec2 fwidthFine(vec2 p);
638 vec3 fwidthFine(vec3 p);
639 vec4 fwidthFine(vec4 p);
640 float fwidthCoarse(float p);
641 vec2 fwidthCoarse(vec2 p);
642 vec3 fwidthCoarse(vec3 p);
643 vec4 fwidthCoarse(vec4 p);
644 float interpolateAtCentroid(float interpolant);
645 vec2 interpolateAtCentroid(vec2 interpolant);
646 vec3 interpolateAtCentroid(vec3 interpolant);
647 vec4 interpolateAtCentroid(vec4 interpolant);
648 float interpolateAtSample(float interpolant, int sample);
649 vec2 interpolateAtSample(vec2 interpolant, int sample);
650 vec3 interpolateAtSample(vec3 interpolant, int sample);
651 vec4 interpolateAtSample(vec4 interpolant, int sample);
652 float interpolateAtOffset(float interpolant, vec2 offset);
653 vec2 interpolateAtOffset(vec2 interpolant, vec2 offset);
654 vec3 interpolateAtOffset(vec3 interpolant, vec2 offset);
655 vec4 interpolateAtOffset(vec4 interpolant, vec2 offset);
656 // END BUILTIN FRAGMENT FUNCTIONS
657
658 in vec4 gl_FragCoord;
659 in bool gl_FrontFacing;
660 in float gl_ClipDistance[];
661 in vec2 gl_PointCoord;
662 in int gl_PrimitiveID;
663 in int gl_SampleID;
664 in vec2 gl_SamplePosition;
665 in int gl_Layer;
666 out float gl_FragDepth;