aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/sksl/sksl.include
blob: aab9930fc906e4ec044de1e32a9e41ab434edb17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
STRINGIFY(

// defines built-in functions supported by SkiaSL

$genType radians($genType degrees);
$genType sin($genType angle);
$genType cos($genType angle);
$genType tan($genType angle);
$genType asin($genType x);
$genType acos($genType x);
$genType atan($genType y, $genType x);
$genType atan($genType y_over_x);
$genType sinh($genType x);
$genType cosh($genType x);
$genType tanh($genType x);
$genType asinh($genType x);
$genType acosh($genType x);
$genType atanh($genType x);
$genType pow($genType x, $genType y);
$genType exp($genType x);
$genType log($genType x);
$genType exp2($genType x);
$genType log2($genType x);
$genType sqrt($genType x);
//$genDType sqrt($genDType x);
$genType inversesqrt($genType x);
//$genDType inversesqrt($genDType x);
$genType abs($genType x);
$genIType abs($genIType x);
//$genDType abs($genDType x);
$genType sign($genType x);
$genIType sign($genIType x);
//$genDType sign($genDType x);
$genType floor($genType x);
//$genDType floor($genDType x);
$genType trunc($genType x);
//$genDType trunc($genDType x);
$genType round($genType x);
//$genDType round($genDType x);
$genType roundEven($genType x);
//$genDType roundEven($genDType x);
$genType ceil($genType x);
//$genDType ceil($genDType x);
$genType fract($genType x);
//$genDType fract($genDType x);
$genType mod($genType x, highfloat y);
$genType mod($genType x, $genType y);
//$genDType mod($genDType x, double y);
//$genDType mod($genDType x, $genDType y);
$genType modf($genType x, out $genType i);
//$genDType modf($genDType x, out $genDType i);
$genType min($genType x, $genType y);
$genType min($genType x, highfloat y);
//$genDType min($genDType x, $genDType y);
//$genDType min($genDType x, double y);
$genIType min($genIType x, $genIType y);
$genIType min($genIType x, int y);
//$genUType min($genUType x, $genUType y);
//$genUType min($genUType x, uint y);
$genType max($genType x, $genType y);
$genType max($genType x, highfloat y);
//$genDType max($genDType x, $genDType y);
//$genDType max($genDType x, double y);
$genIType max($genIType x, $genIType y);
$genIType max($genIType x, int y);
//$genUType max($genUType x, $genUType y);
//$genUType max($genUType x, uint y);
$genType clamp($genType x, $genType minVal, $genType maxVal);
$genType clamp($genType x, highfloat minVal, highfloat maxVal);
//$genDType clamp($genDType x, $genDType minVal, $genDType maxVal);
//$genDType clamp($genDType x, double minVal, double maxVal);
$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
$genIType clamp($genIType x, int minVal, int maxVal);
//$genUType clamp($genUType x, $genUType minVal, $genUType maxVal);
//$genUType clamp($genUType x, uint minVal, uint maxVal);
$genType mix($genType x, $genType y, $genType a);
$genType mix($genType x, $genType y, highfloat a);
//$genDType mix($genDType x, $genDType y, $genDType a);
//$genDType mix($genDType x, $genDType y, double a);
$genType mix($genType x, $genType y, $genBType a);
//$genDType mix($genDType x, $genDType y, $genBType a);
$genIType mix($genIType x, $genIType y, $genBType a);
//$genUType mix($genUType x, $genUType y, $genBType a);
$genBType mix($genBType x, $genBType y, $genBType a);
$genType step($genType edge, $genType x);
$genType step(highfloat edge, $genType x);
//$genDType step($genDType edge, $genDType x);
//$genDType step(double edge, $genDType x);
$genType smoothstep($genType edge0, $genType edge1, $genType x);
$genType smoothstep(highfloat edge0, highfloat edge1, $genType x);
//$genDType smoothstep($genDType edge0, $genDType edge1, $genDType x);
//$genDType smoothstep(double edge0, double edge1, $genDType x);
$genBType isnan($genType x);
$genBType isnan($genDType x);
$genBType isinf($genType x);
$genBType isinf($genDType x);
$genIType highfloatBitsToInt($genType value);
//$genUType highfloatBitsToUint($genType value);
$genType intBitsTohighfloat($genIType value);
$genType uintBitsTohighfloat($genUType value);
$genType fma($genType a, $genType b, $genType c);
$genHType fma($genHType a, $genHType b, $genHType c);
$genDType fma($genDType a, $genDType b, $genDType c);
//$genDType fma($genDType a, $genDType b, $genDType c);
$genType frexp($genType x, out $genIType exp);
//$genDType frexp($genDType x, out $genIType exp);
$genType ldexp($genType x, in $genIType exp);
//$genDType ldexp($genDType x, in $genIType exp);
uint packUnorm2x16(highfloat2 v);
uint packSnorm2x16(highfloat2 v);
uint packUnorm4x8(highfloat4 v);
uint packSnorm4x8(highfloat4 v);
highfloat2 unpackUnorm2x16(uint p);
highfloat2 unpackSnorm2x16(uint p);
highfloat4 unpackUnorm4x8(uint p);
highfloat4 unpackSnorm4x8(uint p);
//double packDouble2x32(uint2 v);
uint2 unpackDouble2x32(double v);
uint packHalf2x16(highfloat2 v);
highfloat2 unpackHalf2x16(uint v);
highfloat length($genType x);
half length($genHType x);
double length($genDType x);
highfloat distance($genType p0, $genType p1);
half distance($genHType p0, $genHType p1);
double distance($genDType p0, $genDType p1);
highfloat dot($genType x, $genType y);
half dot($genHType x, $genHType y);
double dot($genDType x, $genDType y);
highfloat3 cross(highfloat3 x, highfloat3 y);
half3 cross(half3 x, half3 y);
double3 cross(double3 x, double3 y);
$genType normalize($genType x);
$genHType normalize($genHType x);
$genDType normalize($genDType x);
highfloat4 ftransform();
$genType faceforward($genType N, $genType I, $genType Nref);
$genHType faceforward($genHType N, $genHType I, $genHType Nref);
$genDType faceforward($genDType N, $genDType I, $genDType Nref);
$genType reflect($genType I, $genType N);
$genHType reflect($genHType I, $genHType N);
$genDType reflect($genDType I, $genDType N);
$genType refract($genType I, $genType N, highfloat eta);
$genHType refract($genHType I, $genHType N, highfloat eta);
$genDType refract($genDType I, $genDType N, highfloat eta);
$mat matrixCompMult($mat x, $mat y);
highfloat2x2 outerProduct(highfloat2 c, highfloat2 r);
highfloat3x3 outerProduct(highfloat3 c, highfloat3 r);
highfloat4x3 outerProduct(highfloat4 c, highfloat4 r);
highfloat2x3 outerProduct(highfloat3 c, highfloat2 r);
highfloat3x2 outerProduct(highfloat2 c, highfloat3 r);
highfloat2x4 outerProduct(highfloat4 c, highfloat2 r);
highfloat4x2 outerProduct(highfloat2 c, highfloat4 r);
highfloat3x4 outerProduct(highfloat4 c, highfloat3 r);
highfloat4x3 outerProduct(highfloat3 c, highfloat4 r);
highfloat2x2 transpose(highfloat2x2 m);
highfloat3x3 transpose(highfloat3x3 m);
highfloat4x4 transpose(highfloat4x4 m);
highfloat2x3 transpose(highfloat3x2 m);
highfloat3x2 transpose(highfloat2x3 m);
highfloat2x4 transpose(highfloat4x2 m);
highfloat4x2 transpose(highfloat2x4 m);
highfloat3x4 transpose(highfloat4x3 m);
highfloat4x3 transpose(highfloat3x4 m);
highfloat determinant(highfloat2x2 m);
highfloat determinant(highfloat3x3 m);
highfloat determinant(highfloat4x4 m);
highfloat2x2 inverse(highfloat2x2 m);
highfloat3x3 inverse(highfloat3x3 m);
highfloat4x4 inverse(highfloat4x4 m);
$bvec lessThan($vec x, $vec y);
$bvec lessThan($hvec x, $hvec y);
$bvec lessThan($dvec x, $dvec y);
$bvec lessThan($ivec x, $ivec y);
$bvec lessThan($svec x, $svec y);
$bvec lessThan($usvec x, $usvec y);
$bvec lessThan($uvec x, $uvec y);
$bvec lessThanEqual($vec x, $vec y);
$bvec lessThanEqual($hvec x, $hvec y);
$bvec lessThanEqual($dvec x, $dvec y);
$bvec lessThanEqual($ivec x, $ivec y);
$bvec lessThanEqual($uvec x, $uvec y);
$bvec lessThanEqual($svec x, $svec y);
$bvec lessThanEqual($usvec x, $usvec y);
$bvec greaterThan($vec x, $vec y);
$bvec greaterThan($hvec x, $hvec y);
$bvec greaterThan($dvec x, $dvec y);
$bvec greaterThan($ivec x, $ivec y);
$bvec greaterThan($uvec x, $uvec y);
$bvec greaterThan($svec x, $svec y);
$bvec greaterThan($usvec x, $usvec y);
$bvec greaterThanEqual($vec x, $vec y);
$bvec greaterThanEqual($hvec x, $hvec y);
$bvec greaterThanEqual($dvec x, $dvec y);
$bvec greaterThanEqual($ivec x, $ivec y);
$bvec greaterThanEqual($uvec x, $uvec y);
$bvec greaterThanEqual($svec x, $svec y);
$bvec greaterThanEqual($usvec x, $usvec y);
$bvec equal($vec x, $vec y);
$bvec equal($hvec x, $hvec y);
$bvec equal($dvec x, $dvec y);
$bvec equal($ivec x, $ivec y);
$bvec equal($uvec x, $uvec y);
$bvec equal($svec x, $svec y);
$bvec equal($usvec x, $usvec y);
$bvec equal($bvec x, $bvec y);
$bvec notEqual($vec x, $vec y);
$bvec notEqual($hvec x, $hvec y);
$bvec notEqual($dvec x, $dvec y);
$bvec notEqual($ivec x, $ivec y);
$bvec notEqual($uvec x, $uvec y);
$bvec notEqual($svec x, $svec y);
$bvec notEqual($usvec x, $usvec y);
$bvec notEqual($bvec x, $bvec y);
bool any($bvec x);
bool all($bvec x);
$bvec not($bvec x);

$genIType bitCount($genIType value);
$genIType bitCount($genUType value);
$genIType findLSB($genIType value);
$genIType findLSB($genUType value);
$genIType findMSB($genIType value);
$genIType findMSB($genUType value);

/*
//$genUType uaddCarry($genUType x, $genUType y, out $genUType carry);
//$genUType usubBorrow($genUType x, $genUType y, out $genUType borrow);
void umulExtended($genUType x, $genUType y, out $genUType msb, out $genUType lsb);
void imulExtended($genIType x, $genIType y, out $genIType msb, out $genIType lsb);
$genIType bitfieldExtract($genIType value, int offset, int bits);
//$genUType bitfieldExtract($genUType value, int offset, int bits);
$genIType bitfieldInsert($genIType base, $genIType insert, int offset, int bits);
//$genUType bitfieldInsert($genUType base, $genUType insert, int offset, int bits);
$genIType bitfieldReverse($genIType value);
//$genUType bitfieldReverse($genUType value);
int textureSize($gsampler1D sampler, int lod);
int2 textureSize($gsampler2D sampler, int lod);
int3 textureSize($gsampler3D sampler, int lod);
int2 textureSize($gsamplerCube sampler, int lod);
int textureSize(sampler1DShadow sampler, int lod);
int2 textureSize(sampler2DShadow sampler, int lod);
int2 textureSize(samplerCubeShadow sampler, int lod);
int3 textureSize($gsamplerCubeArray sampler, int lod);
int3 textureSize(samplerCubeArrayShadow sampler, int lod);
*/
int2 textureSize($gsampler2DRect sampler);
/*
int2 textureSize(sampler2DRectShadow sampler);
int2 textureSize($gsampler1DArray sampler, int lod);
int3 textureSize($gsampler2DArray sampler, int lod);
int2 textureSize(sampler1DArrayShadow sampler, int lod);
int3 textureSize(sampler2DArrayShadow sampler, int lod);
int textureSize($gsamplerBuffer sampler);
int2 textureSize($gsampler2DMS sampler);
int3 textureSize($gsampler2DMSArray sampler);
highfloat2 textureQueryLod($gsampler1D sampler, highfloat P);
highfloat2 textureQueryLod($gsampler2D sampler, highfloat2 P);
highfloat2 textureQueryLod($gsampler3D sampler, highfloat3 P);
highfloat2 textureQueryLod($gsamplerCube sampler, highfloat3 P);
highfloat2 textureQueryLod($gsampler1DArray sampler, highfloat P);
highfloat2 textureQueryLod($gsampler2DArray sampler, highfloat2 P);
highfloat2 textureQueryLod($gsamplerCubeArray sampler, highfloat3 P);
highfloat2 textureQueryLod(sampler1DShadow sampler, highfloat P);
highfloat2 textureQueryLod(sampler2DShadow sampler, highfloat2 P);
highfloat2 textureQueryLod(samplerCubeShadow sampler, highfloat3 P);
highfloat2 textureQueryLod(sampler1DArrayShadow sampler, highfloat P);
highfloat2 textureQueryLod(sampler2DArrayShadow sampler, highfloat2 P);
highfloat2 textureQueryLod(samplerCubeArrayShadow sampler, highfloat3 P);
int textureQueryLevels($gsampler1D sampler);
int textureQueryLevels($gsampler2D sampler);
int textureQueryLevels($gsampler3D sampler);
int textureQueryLevels($gsamplerCube sampler);
int textureQueryLevels($gsampler1DArray sampler);
int textureQueryLevels($gsampler2DArray sampler);
int textureQueryLevels($gsamplerCubeArray sampler);
int textureQueryLevels(sampler1DShadow sampler);
int textureQueryLevels(sampler2DShadow sampler);
int textureQueryLevels(samplerCubeShadow sampler);
int textureQueryLevels(sampler1DArrayShadow sampler);
int textureQueryLevels(sampler2DArrayShadow sampler);
int textureQueryLevels(samplerCubeArrayShadow sampler);
*/

half4 texture($gsampler1D sampler, highfloat P);
half4 texture($gsampler1D sampler, highfloat P, highfloat bias);
half4 texture($gsampler2D sampler, highfloat2 P);
// The above currently only expand to handle the float/fixed case. So we also declare this integer
// version of texture().
int4 texture(isampler2D sampler, highfloat2 P);
half4 texture(samplerExternalOES sampler, highfloat2 P, highfloat bias);
half4 texture(samplerExternalOES sampler, highfloat2 P);

/*
$gfloat4 texture($gsampler2D sampler, highfloat2 P, highfloat bias);
$gfloat4 texture($gsampler3D sampler, highfloat3 P);
$gfloat4 texture($gsampler3D sampler, highfloat3 P, highfloat bias);
$gfloat4 texture($gsamplerCube sampler, highfloat3 P);
$gfloat4 texture($gsamplerCube sampler, highfloat3 P, highfloat bias);
highfloat texture(sampler1DShadow sampler, highfloat3 P);
highfloat texture(sampler1DShadow sampler, highfloat3 P, highfloat bias);
highfloat texture(sampler2DShadow sampler, highfloat3 P);
highfloat texture(sampler2DShadow sampler, highfloat3 P, highfloat bias);
highfloat texture(samplerCubeShadow sampler, highfloat4 P);
highfloat texture(samplerCubeShadow sampler, highfloat4 P, highfloat bias);
$gfloat4 texture($gsampler1DArray sampler, highfloat2 P);
$gfloat4 texture($gsampler1DArray sampler, highfloat2 P, highfloat bias);
$gfloat4 texture($gsampler2DArray sampler, highfloat3 P);
$gfloat4 texture($gsampler2DArray sampler, highfloat3 P, highfloat bias);
$gfloat4 texture($gsamplerCubeArray sampler, highfloat4 P);
$gfloat4 texture($gsamplerCubeArray sampler, highfloat4 P, highfloat bias);
highfloat texture(sampler1DArrayShadow sampler, highfloat3 P);
highfloat texture(sampler1DArrayShadow sampler, highfloat3 P, highfloat bias);
highfloat texture(sampler2DArrayShadow sampler, highfloat4 P);
*/

half4 texture($gsampler2DRect sampler, highfloat2 P);
half4 texture($gsampler2DRect sampler, highfloat3 P);

/*
highfloat texture(sampler2DRectShadow sampler, highfloat3 P);
highfloat texture($gsamplerCubeArrayShadow sampler, highfloat4 P, highfloat compare);
*/

// Currently we do not support the generic types of loading subpassInput so we have some explicit
// versions that we currently use
highfloat4 subpassLoad(subpassInput subpass);
highfloat4 subpassLoad(subpassInputMS subpass, int sample);
/*
$gfloat4subpassLoad(gsubpassInput subpass);
$gfloat4subpassLoad(gsubpassInputMS subpass, int sample);
*/
)

// split into multiple chunks, as MSVC++ complains if a single string is too long

STRINGIFY(

half4 texture($gsampler1D sampler, highfloat2 P);
half4 texture($gsampler1D sampler, highfloat2 P, highfloat bias);
half4 texture($gsampler2D sampler, highfloat3 P);
half4 texture($gsampler2D sampler, highfloat3 P, highfloat bias);
/*
$gfloat4 textureProj($gsampler3D sampler, highfloat4 P);
$gfloat4 textureProj($gsampler3D sampler, highfloat4 P, highfloat bias);
highfloat textureProj(sampler1DShadow sampler, highfloat4 P);
highfloat textureProj(sampler1DShadow sampler, highfloat4 P, highfloat bias);
highfloat textureProj(sampler2DShadow sampler, highfloat4 P);
highfloat textureProj(sampler2DShadow sampler, highfloat4 P, highfloat bias);
$gfloat4 textureProj($gsampler2DRect sampler, highfloat4 P);
highfloat textureProj(sampler2DRectShadow sampler, highfloat4 P);
$gfloat4 textureLod($gsampler1D sampler, highfloat P, highfloat lod);
$gfloat4 textureLod($gsampler2D sampler, highfloat2 P, highfloat lod);
$gfloat4 textureLod($gsampler3D sampler, highfloat3 P, highfloat lod);
$gfloat4 textureLod($gsamplerCube sampler, highfloat3 P, highfloat lod);
highfloat textureLod(sampler1DShadow sampler, highfloat3 P, highfloat lod);
highfloat textureLod(sampler2DShadow sampler, highfloat3 P, highfloat lod);
$gfloat4 textureLod($gsampler1DArray sampler, highfloat2 P, highfloat lod);
$gfloat4 textureLod($gsampler2DArray sampler, highfloat3 P, highfloat lod);
highfloat textureLod(sampler1DArrayShadow sampler, highfloat3 P, highfloat lod);
$gfloat4 textureLod($gsamplerCubeArray sampler, highfloat4 P, highfloat lod);
$gfloat4 textureOffset($gsampler1D sampler, highfloat P, int offset);
$gfloat4 textureOffset($gsampler1D sampler, highfloat P, int offset, highfloat bias);
$gfloat4 textureOffset($gsampler2D sampler, highfloat2 P, int2 offset);
$gfloat4 textureOffset($gsampler2D sampler, highfloat2 P, int2 offset, highfloat bias);
$gfloat4 textureOffset($gsampler3D sampler, highfloat3 P, int3 offset);
$gfloat4 textureOffset($gsampler3D sampler, highfloat3 P, int3 offset, highfloat bias);
$gfloat4 textureOffset($gsampler2DRect sampler, highfloat2 P, int2 offset);
highfloat textureOffset(sampler2DRectShadow sampler, highfloat3 P, int2 offset);
highfloat textureOffset(sampler1DShadow sampler, highfloat3 P, int offset);
highfloat textureOffset(sampler1DShadow sampler, highfloat3 P, int offset, highfloat bias);
highfloat textureOffset(sampler2DShadow sampler, highfloat3 P, int2 offset);
highfloat textureOffset(sampler2DShadow sampler, highfloat3 P, int2 offset, highfloat bias);
$gfloat4 textureOffset($gsampler1DArray sampler, highfloat2 P, int offset);
$gfloat4 textureOffset($gsampler1DArray sampler, highfloat2 P, int offset, highfloat bias);
$gfloat4 textureOffset($gsampler2DArray sampler, highfloat3 P, int2 offset);
$gfloat4 textureOffset($gsampler2DArray sampler, highfloat3 P, int2 offset, highfloat bias);
highfloat textureOffset(sampler1DArrayShadow sampler, highfloat3 P, int offset);
highfloat textureOffset(sampler1DArrayShadow sampler, highfloat3 P, int offset, highfloat bias);
highfloat textureOffset(sampler2DArrayShadow sampler, highfloat4 P, int2 offset);
*/
highfloat4 texelFetch(samplerBuffer sampler, int P);

$gfloat4 texelFetch($gsampler1D sampler, int P, int lod);
$gfloat4 texelFetch($gsampler2D sampler, int2 P, int lod);
$gfloat4 texelFetch($gsampler2DRect sampler, int2 P);
/*
$gfloat4 texelFetch($gsampler3D sampler, int3 P, int lod);
$gfloat4 texelFetch($gsampler1DArray sampler, int2 P, int lod);
$gfloat4 texelFetch($gsampler2DArray sampler, int3 P, int lod);
$gfloat4 texelFetch($gsampler2DMS sampler, int2 P, int sample);
$gfloat4 texelFetch($gsampler2DMSArray sampler, int3 P, int sample);
$gfloat4 texelFetchOffset($gsampler1D sampler, int P, int lod, int offset);
$gfloat4 texelFetchOffset($gsampler2D sampler, int2 P, int lod, int2 offset);
$gfloat4 texelFetchOffset($gsampler3D sampler, int3 P, int lod, int3 offset);
$gfloat4 texelFetchOffset($gsampler2DRect sampler, int2 P, int2 offset);
$gfloat4 texelFetchOffset($gsampler1DArray sampler, int2 P, int lod, int offset);
$gfloat4 texelFetchOffset($gsampler2DArray sampler, int3 P, int lod, int2 offset);
$gfloat4 textureProjOffset($gsampler1D sampler, highfloat2 P, int offset);
$gfloat4 textureProjOffset($gsampler1D sampler, highfloat2 P, int offset, highfloat bias);
$gfloat4 textureProjOffset($gsampler1D sampler, highfloat4 P, int offset);
$gfloat4 textureProjOffset($gsampler1D sampler, highfloat4 P, int offset, highfloat bias);
$gfloat4 textureProjOffset($gsampler2D sampler, highfloat3 P, int2 offset);
$gfloat4 textureProjOffset($gsampler2D sampler, highfloat3 P, int2 offset, highfloat bias);
$gfloat4 textureProjOffset($gsampler2D sampler, highfloat4 P, int2 offset);
$gfloat4 textureProjOffset($gsampler2D sampler, highfloat4 P, int2 offset, highfloat bias);
$gfloat4 textureProjOffset($gsampler3D sampler, highfloat4 P, int3 offset);
$gfloat4 textureProjOffset($gsampler3D sampler, highfloat4 P, int3 offset, highfloat bias);
$gfloat4 textureProjOffset($gsampler2DRect sampler, highfloat3 P, int2 offset);
$gfloat4 textureProjOffset($gsampler2DRect sampler, highfloat4 P, int2 offset);
highfloat textureProjOffset(sampler2DRectShadow sampler, highfloat4 P, int2 offset);
highfloat textureProjOffset(sampler1DShadow sampler, highfloat4 P, int offset);
highfloat textureProjOffset(sampler1DShadow sampler, highfloat4 P, int offset, highfloat bias);
highfloat textureProjOffset(sampler2DShadow sampler, highfloat4 P, int2 offset);
highfloat textureProjOffset(sampler2DShadow sampler, highfloat4 P, int2 offset, highfloat bias);
$gfloat4 textureLodOffset($gsampler1D sampler, highfloat P, highfloat lod, int offset);
$gfloat4 textureLodOffset($gsampler2D sampler, highfloat2 P, highfloat lod, int2 offset);
$gfloat4 textureLodOffset($gsampler3D sampler, highfloat3 P, highfloat lod, int3 offset);
highfloat textureLodOffset(sampler1DShadow sampler, highfloat3 P, highfloat lod, int offset);
highfloat textureLodOffset(sampler2DShadow sampler, highfloat3 P, highfloat lod, int2 offset);
$gfloat4 textureLodOffset($gsampler1DArray sampler, highfloat2 P, highfloat lod, int offset);
$gfloat4 textureLodOffset($gsampler2DArray sampler, highfloat3 P, highfloat lod, int2 offset);
highfloat textureLodOffset(sampler1DArrayShadow sampler, highfloat3 P, highfloat lod, int offset);
$gfloat4 textureProjLod($gsampler1D sampler, highfloat2 P, highfloat lod);
$gfloat4 textureProjLod($gsampler1D sampler, highfloat4 P, highfloat lod);
$gfloat4 textureProjLod($gsampler2D sampler, highfloat3 P, highfloat lod);
$gfloat4 textureProjLod($gsampler2D sampler, highfloat4 P, highfloat lod);
$gfloat4 textureProjLod($gsampler3D sampler, highfloat4 P, highfloat lod);
highfloat textureProjLod(sampler1DShadow sampler, highfloat4 P, highfloat lod);
highfloat textureProjLod(sampler2DShadow sampler, highfloat4 P, highfloat lod);
$gfloat4 textureProjLodOffset($gsampler1D sampler, highfloat2 P, highfloat lod, int offset);
$gfloat4 textureProjLodOffset($gsampler1D sampler, highfloat4 P, highfloat lod, int offset);
$gfloat4 textureProjLodOffset($gsampler2D sampler, highfloat3 P, highfloat lod, int2 offset);
$gfloat4 textureProjLodOffset($gsampler2D sampler, highfloat4 P, highfloat lod, int2 offset);
$gfloat4 textureProjLodOffset($gsampler3D sampler, highfloat4 P, highfloat lod, int3 offset);
highfloat textureProjLodOffset(sampler1DShadow sampler, highfloat4 P, highfloat lod, int offset);
highfloat textureProjLodOffset(sampler2DShadow sampler, highfloat4 P, highfloat lod, int2 offset);
$gfloat4 textureGrad($gsampler1D sampler, highfloat P, highfloat dPdx, highfloat dPdy);
$gfloat4 textureGrad($gsampler2D sampler, highfloat2 P, highfloat2 dPdx, highfloat2 dPdy);
$gfloat4 textureGrad($gsampler3D sampler, highfloat3 P, highfloat3 dPdx, highfloat3 dPdy);
$gfloat4 textureGrad($gsamplerCube sampler, highfloat3 P, highfloat3 dPdx, highfloat3 dPdy);
$gfloat4 textureGrad($gsampler2DRect sampler, highfloat2 P, highfloat2 dPdx, highfloat2 dPdy);
highfloat textureGrad(sampler2DRectShadow sampler, highfloat3 P, highfloat2 dPdx, highfloat2 dPdy);
highfloat textureGrad(sampler1DShadow sampler, highfloat3 P, highfloat dPdx, highfloat dPdy);
highfloat textureGrad(sampler2DShadow sampler, highfloat3 P, highfloat2 dPdx, highfloat2 dPdy);
highfloat textureGrad(samplerCubeShadow sampler, highfloat4 P, highfloat3 dPdx, highfloat3 dPdy);
$gfloat4 textureGrad($gsampler1DArray sampler, highfloat2 P, highfloat dPdx, highfloat dPdy);
$gfloat4 textureGrad($gsampler2DArray sampler, highfloat3 P, highfloat2 dPdx, highfloat2 dPdy);
highfloat textureGrad(sampler1DArrayShadow sampler, highfloat3 P, highfloat dPdx, highfloat dPdy);
highfloat textureGrad(sampler2DArrayShadow sampler, highfloat4 P, highfloat2 dPdx, highfloat2 dPdy);
$gfloat4 textureGrad($gsamplerCubeArray sampler, highfloat4 P, highfloat3 dPdx, highfloat3 dPdy);
$gfloat4 textureGradOffset($gsampler1D sampler, highfloat P, highfloat dPdx, highfloat dPdy, int offset);
$gfloat4 textureGradOffset($gsampler2D sampler, highfloat2 P, highfloat2 dPdx, highfloat2 dPdy, int2 offset);
$gfloat4 textureGradOffset($gsampler3D sampler, highfloat3 P, highfloat3 dPdx, highfloat3 dPdy, int3 offset);
$gfloat4 textureGradOffset($gsampler2DRect sampler, highfloat2 P, highfloat2 dPdx, highfloat2 dPdy, int2 offset);
highfloat textureGradOffset(sampler2DRectShadow sampler, highfloat3 P, highfloat2 dPdx, highfloat2 dPdy, int2 offset);
highfloat textureGradOffset(sampler1DShadow sampler, highfloat3 P, highfloat dPdx, highfloat dPdy, int offset );
highfloat textureGradOffset(sampler2DShadow sampler, highfloat3 P, highfloat2 dPdx, highfloat2 dPdy, int2 offset);
$gfloat4 textureGradOffset($gsampler1DArray sampler, highfloat2 P, highfloat dPdx, highfloat dPdy, int offset);
$gfloat4 textureGradOffset($gsampler2DArray sampler, highfloat3 P, highfloat2 dPdx, highfloat2 dPdy, int2 offset);
highfloat textureGradOffset(sampler1DArrayShadow sampler, highfloat3 P, highfloat dPdx, highfloat dPdy, int offset);
highfloat textureGradOffset(sampler2DArrayShadow sampler, highfloat4 P, highfloat2 dPdx, highfloat2 dPdy, int2 offset);
$gfloat4 textureProjGrad($gsampler1D sampler, highfloat2 P, highfloat dPdx, highfloat dPdy);
$gfloat4 textureProjGrad($gsampler1D sampler, highfloat4 P, highfloat dPdx, highfloat dPdy);
$gfloat4 textureProjGrad($gsampler2D sampler, highfloat3 P, highfloat2 dPdx, highfloat2 dPdy);
$gfloat4 textureProjGrad($gsampler2D sampler, highfloat4 P, highfloat2 dPdx, highfloat2 dPdy);
$gfloat4 textureProjGrad($gsampler3D sampler, highfloat4 P, highfloat3 dPdx, highfloat3 dPdy);
$gfloat4 textureProjGrad($gsampler2DRect sampler, highfloat3 P, highfloat2 dPdx, highfloat2 dPdy);
$gfloat4 textureProjGrad($gsampler2DRect sampler, highfloat4 P, highfloat2 dPdx, highfloat2 dPdy);
highfloat textureProjGrad(sampler2DRectShadow sampler, highfloat4 P, highfloat2 dPdx, highfloat2 dPdy);
highfloat textureProjGrad(sampler1DShadow sampler, highfloat4 P, highfloat dPdx, highfloat dPdy);
highfloat textureProjGrad(sampler2DShadow sampler, highfloat4 P, highfloat2 dPdx, highfloat2 dPdy);
$gfloat4 textureProjGradOffset($gsampler1D sampler, highfloat2 P, highfloat dPdx, highfloat dPdy, int offset);
$gfloat4 textureProjGradOffset($gsampler1D sampler, highfloat4 P, highfloat dPdx, highfloat dPdy, int offset);
$gfloat4 textureProjGradOffset($gsampler2D sampler, highfloat3 P, highfloat2 dPdx, highfloat2 dPdy, int2 offset);
$gfloat4 textureProjGradOffset($gsampler2D sampler, highfloat4 P, highfloat2 dPdx, highfloat2 dPdy, int2 offset);
$gfloat4 textureProjGradOffset($gsampler2DRect sampler, highfloat3 P, highfloat2 dPdx, highfloat2 dPdy, int2 offset);
$gfloat4 textureProjGradOffset($gsampler2DRect sampler, highfloat4 P, highfloat2 dPdx, highfloat2 dPdy, int2 offset);
highfloat textureProjGradOffset(sampler2DRectShadow sampler, highfloat4 P, highfloat2 dPdx, highfloat2 dPdy, int2 offset);
$gfloat4 textureProjGradOffset($gsampler3D sampler, highfloat4 P, highfloat3 dPdx, highfloat3 dPdy, int3 offset);
highfloat textureProjGradOffset(sampler1DShadow sampler, highfloat4 P, highfloat dPdx, highfloat dPdy, int offset);
highfloat textureProjGradOffset(sampler2DShadow sampler, highfloat4 P, highfloat2 dPdx, highfloat2 dPdy, int2 offset);
$gfloat4 textureGather($gsampler2D sampler, highfloat2 P);
$gfloat4 textureGather($gsampler2D sampler, highfloat2 P, int comp);
$gfloat4 textureGather($gsampler2DArray sampler, highfloat3 P);
$gfloat4 textureGather($gsampler2DArray sampler, highfloat3 P, int comp);
$gfloat4 textureGather($gsamplerCube sampler, highfloat3 P);
$gfloat4 textureGather($gsamplerCube sampler, highfloat3 P, int comp);
$gfloat4 textureGather($gsamplerCubeArray sampler, highfloat4 P);
$gfloat4 textureGather($gsamplerCubeArray sampler, highfloat4 P, int comp);
$gfloat4 textureGather($gsampler2DRect sampler, highfloat2 P);
$gfloat4 textureGather($gsampler2DRect sampler, highfloat2 P, int comp);
highfloat4 textureGather(sampler2DShadow sampler, highfloat2 P, highfloat refZ);
highfloat4 textureGather(sampler2DArrayShadow sampler, highfloat3 P, highfloat refZ);
highfloat4 textureGather(samplerCubeShadow sampler, highfloat3 P, highfloat refZ);
highfloat4 textureGather(samplerCubeArrayShadow sampler, highfloat4 P, highfloat refZ);
highfloat4 textureGather(sampler2DRectShadow sampler, highfloat2 P, highfloat refZ);
$gfloat4 textureGatherOffset($gsampler2D sampler, highfloat2 P, int2 offset);
$gfloat4 textureGatherOffset($gsampler2D sampler, highfloat2 P, int2 offset, int comp);
$gfloat4 textureGatherOffset($gsampler2DArray sampler, highfloat3 P, int2 offset);
$gfloat4 textureGatherOffset($gsampler2DArray sampler, highfloat3 P, int2 offset, int comp);
$gfloat4 textureGatherOffset($gsampler2DRect sampler, highfloat2 P, int2 offset);
$gfloat4 textureGatherOffset($gsampler2DRect sampler, highfloat2 P, int2 offset, int comp);
highfloat4 textureGatherOffset(sampler2DShadow sampler, highfloat2 P, highfloat refZ, int2 offset);
highfloat4 textureGatherOffset(sampler2DArrayShadow sampler, highfloat3 P, highfloat refZ, int2 offset);
highfloat4 textureGatherOffset(sampler2DRectShadow sampler, highfloat2 P, highfloat refZ, int2 offset);
$gfloat4 textureGatherOffsets($gsampler2D sampler, highfloat2 P, int2 offsets[4]);
$gfloat4 textureGatherOffsets($gsampler2D sampler, highfloat2 P, int2 offsets[4], int comp);
$gfloat4 textureGatherOffsets($gsampler2DArray sampler, highfloat3 P, int2 offsets[4]);
$gfloat4 textureGatherOffsets($gsampler2DArray sampler, highfloat3 P, int2 offsets[4], int comp);
$gfloat4 textureGatherOffsets($gsampler2DRect sampler, highfloat2 P, int2 offsets[4]);
$gfloat4 textureGatherOffsets($gsampler2DRect sampler, highfloat2 P, int2 offsets[4], int comp);
highfloat4 textureGatherOffsets(sampler2DShadow sampler, highfloat2 P, highfloat refZ, int2 offsets[4]);
highfloat4 textureGatherOffsets(sampler2DArrayShadow sampler, highfloat3 P, highfloat refZ, int2 offsets[4]);
highfloat4 textureGatherOffsets(sampler2DRectShadow sampler, highfloat2 P, highfloat refZ, int2 offsets[4]);
uint atomicCounterIncrement(atomic_uint c);
uint atomicCounter(atomic_uint c);
uint atomicAdd(inout uint mem, uint data);
int atomicAdd(inout int mem, int data);
uint atomicMin(inout uint mem, uint data);
int atomicMin(inout int mem, int data);
uint atomicMax(inout uint mem, uint data);
int atomicMax(inout int mem, int data);
uint atomicAnd(inout uint mem, uint data);
int atomicAnd(inout int mem, int data);
uint atomicOr(inout uint mem, uint data);
int atomicOr(inout int mem, int data);
uint atomicXor(inout uint mem, uint data);
int atomicXor(inout int mem, int data);
uint atomicExchange(inout uint mem, uint data);
int atomicExchange(inout int mem, int data);
uint atomicCompSwap(inout uint mem, uint compare, uint data);
int atomicCompSwap(inout int mem, int compare, int data);
*/
// section 8.12 Additional Image Functions will go here if and when we add
// support for them
highfloat4 imageLoad(image2D image, int2 P);
int4 imageLoad(iimage2D image, int2 P);
$genType dFdx($genType p);
$genType dFdy($genType p);
highfloat interpolateAtSample(highfloat interpolant, int sample);
highfloat2 interpolateAtSample(highfloat2 interpolant, int sample);
highfloat3 interpolateAtSample(highfloat3 interpolant, int sample);
highfloat4 interpolateAtSample(highfloat4 interpolant, int sample);
highfloat interpolateAtOffset(highfloat interpolant, highfloat2 offset);
highfloat2 interpolateAtOffset(highfloat2 interpolant, highfloat2 offset);
highfloat3 interpolateAtOffset(highfloat3 interpolant, highfloat2 offset);
highfloat4 interpolateAtOffset(highfloat4 interpolant, highfloat2 offset);

/*
$genType fwidth($genType p);
$genType fwidthCoarse($genType p);
$genType fwidthFine($genType p);
void barrier();
void memoryBarrier();
void memoryBarrierAtomicCounter();
void memoryBarrierBuffer();
void memoryBarrierShared();
void memoryBarrierImage();
void groupMemoryBarrier();
*/

)