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