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