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