1STRINGIFY(
2
3// defines built-in functions supported by SkiaSL
4
5$genType radians($genType degrees);
6$genType sin($genType angle);
7$genType cos($genType angle);
8$genType tan($genType angle);
9$genType asin($genType x);
10$genType acos($genType x);
11$genType atan($genType y, $genType x);
12$genType atan($genType y_over_x);
13$genType sinh($genType x);
14$genType cosh($genType x);
15$genType tanh($genType x);
16$genType asinh($genType x);
17$genType acosh($genType x);
18$genType atanh($genType x);
19$genType pow($genType x, $genType y);
20$genType exp($genType x);
21$genType log($genType x);
22$genType exp2($genType x);
23$genType log2($genType x);
24$genType sqrt($genType x);
25$genHType radians($genHType degrees);
26$genHType sin($genHType angle);
27$genHType cos($genHType angle);
28$genHType tan($genHType angle);
29$genHType asin($genHType x);
30$genHType acos($genHType x);
31$genHType atan($genHType y, $genHType x);
32$genHType atan($genHType y_over_x);
33$genHType sinh($genHType x);
34$genHType cosh($genHType x);
35$genHType tanh($genHType x);
36$genHType asinh($genHType x);
37$genHType acosh($genHType x);
38$genHType atanh($genHType x);
39$genHType pow($genHType x, $genHType y);
40$genHType exp($genHType x);
41$genHType log($genHType x);
42$genHType exp2($genHType x);
43$genHType log2($genHType x);
44$genHType sqrt($genHType x);
45//$genDType sqrt($genDType x);
46$genType inversesqrt($genType x);
47//$genDType inversesqrt($genDType x);
48$genType abs($genType x);
49$genHType abs($genHType x);
50$genIType abs($genIType x);
51//$genDType abs($genDType x);
52$genType sign($genType x);
53$genHType sign($genHType x);
54$genIType sign($genIType x);
55//$genDType sign($genDType x);
56$genType floor($genType x);
57$genHType floor($genHType x);
58//$genDType floor($genDType x);
59$genType trunc($genType x);
60$genHType trunc($genHType x);
61//$genDType trunc($genDType x);
62$genType round($genType x);
63$genHType round($genHType x);
64//$genDType round($genDType x);
65$genType roundEven($genType x);
66$genHType roundEven($genHType x);
67//$genDType roundEven($genDType x);
68$genType ceil($genType x);
69$genHType ceil($genHType x);
70//$genDType ceil($genDType x);
71$genType fract($genType x);
72$genHType fract($genHType x);
73//$genDType fract($genDType x);
74$genType mod($genType x, float y);
75$genType mod($genType x, $genType y);
76$genHType mod($genHType x, half y);
77$genHType mod($genHType x, $genType y);
78//$genDType mod($genDType x, double y);
79//$genDType mod($genDType x, $genDType y);
80$genType modf($genType x, out $genType i);
81$genHType modf($genHType x, out $genHType i);
82//$genDType modf($genDType x, out $genDType i);
83$genType min($genType x, $genType y);
84$genType min($genType x, float y);
85$genHType min($genHType x, $genHType y);
86$genHType min($genHType x, half y);
87//$genDType min($genDType x, $genDType y);
88//$genDType min($genDType x, double y);
89$genIType min($genIType x, $genIType y);
90$genIType min($genIType x, int y);
91//$genUType min($genUType x, $genUType y);
92//$genUType min($genUType x, uint y);
93$genType max($genType x, $genType y);
94$genType max($genType x, float y);
95$genHType max($genHType x, $genHType y);
96$genHType max($genHType x, half y);
97//$genDType max($genDType x, $genDType y);
98//$genDType max($genDType x, double y);
99$genIType max($genIType x, $genIType y);
100$genIType max($genIType x, int y);
101//$genUType max($genUType x, $genUType y);
102//$genUType max($genUType x, uint y);
103$genType clamp($genType x, $genType minVal, $genType maxVal);
104$genType clamp($genType x, float minVal, float maxVal);
105$genHType clamp($genHType x, $genHType minVal, $genHType maxVal);
106$genHType clamp($genHType x, half minVal, half maxVal);
107//$genDType clamp($genDType x, $genDType minVal, $genDType maxVal);
108//$genDType clamp($genDType x, double minVal, double maxVal);
109$genIType clamp($genIType x, $genIType minVal, $genIType maxVal);
110$genIType clamp($genIType x, int minVal, int maxVal);
111//$genUType clamp($genUType x, $genUType minVal, $genUType maxVal);
112//$genUType clamp($genUType x, uint minVal, uint maxVal);
113$genType saturate($genType x);
114$genHType saturate($genHType x);
115$genType mix($genType x, $genType y, $genType a);
116$genType mix($genType x, $genType y, float a);
117$genHType mix($genHType x, $genHType y, $genHType a);
118$genHType mix($genHType x, $genHType y, half a);
119//$genDType mix($genDType x, $genDType y, $genDType a);
120//$genDType mix($genDType x, $genDType y, double a);
121$genType mix($genType x, $genType y, $genBType a);
122//$genDType mix($genDType x, $genDType y, $genBType a);
123$genIType mix($genIType x, $genIType y, $genBType a);
124//$genUType mix($genUType x, $genUType y, $genBType a);
125$genBType mix($genBType x, $genBType y, $genBType a);
126$genType step($genType edge, $genType x);
127$genType step(float edge, $genType x);
128$genHType step($genHType edge, $genHType x);
129$genHType step(half edge, $genHType x);
130//$genDType step($genDType edge, $genDType x);
131//$genDType step(double edge, $genDType x);
132$genType smoothstep($genType edge0, $genType edge1, $genType x);
133$genType smoothstep(float edge0, float edge1, $genType x);
134$genHType smoothstep($genHType edge0, $genHType edge1, $genHType x);
135$genHType smoothstep(half edge0, half edge1, $genHType x);
136//$genDType smoothstep($genDType edge0, $genDType edge1, $genDType x);
137//$genDType smoothstep(double edge0, double edge1, $genDType x);
138$genBType isnan($genType x);
139$genBType isnan($genDType x);
140$genBType isinf($genType x);
141$genBType isinf($genDType x);
142$genIType floatBitsToInt($genType value);
143//$genUType floatBitsToUint($genType value);
144$genType intBitsTofloat($genIType value);
145$genType uintBitsTofloat($genUType value);
146$genType fma($genType a, $genType b, $genType c);
147$genHType fma($genHType a, $genHType b, $genHType c);
148$genDType fma($genDType a, $genDType b, $genDType c);
149//$genDType fma($genDType a, $genDType b, $genDType c);
150sk_has_side_effects $genType frexp($genType x, out $genIType exp);
151//$genDType frexp($genDType x, out $genIType exp);
152$genType ldexp($genType x, in $genIType exp);
153//$genDType ldexp($genDType x, in $genIType exp);
154uint packUnorm2x16(float2 v);
155uint packSnorm2x16(float2 v);
156uint packUnorm4x8(float4 v);
157uint packSnorm4x8(float4 v);
158float2 unpackUnorm2x16(uint p);
159float2 unpackSnorm2x16(uint p);
160float4 unpackUnorm4x8(uint p);
161float4 unpackSnorm4x8(uint p);
162//double packDouble2x32(uint2 v);
163uint2 unpackDouble2x32(double v);
164uint packHalf2x16(float2 v);
165float2 unpackHalf2x16(uint v);
166float length($genType x);
167half length($genHType x);
168double length($genDType x);
169float distance($genType p0, $genType p1);
170half distance($genHType p0, $genHType p1);
171double distance($genDType p0, $genDType p1);
172float dot($genType x, $genType y);
173half dot($genHType x, $genHType y);
174double dot($genDType x, $genDType y);
175float3 cross(float3 x, float3 y);
176half3 cross(half3 x, half3 y);
177double3 cross(double3 x, double3 y);
178$genType normalize($genType x);
179$genHType normalize($genHType x);
180$genDType normalize($genDType x);
181float4 ftransform();
182$genType faceforward($genType N, $genType I, $genType Nref);
183$genHType faceforward($genHType N, $genHType I, $genHType Nref);
184$genDType faceforward($genDType N, $genDType I, $genDType Nref);
185$genType reflect($genType I, $genType N);
186$genHType reflect($genHType I, $genHType N);
187$genDType reflect($genDType I, $genDType N);
188$genType refract($genType I, $genType N, float eta);
189$genHType refract($genHType I, $genHType N, float eta);
190$genDType refract($genDType I, $genDType N, float eta);
191$mat matrixCompMult($mat x, $mat y);
192float2x2 outerProduct(float2 c, float2 r);
193float3x3 outerProduct(float3 c, float3 r);
194float4x3 outerProduct(float4 c, float4 r);
195float2x3 outerProduct(float3 c, float2 r);
196float3x2 outerProduct(float2 c, float3 r);
197float2x4 outerProduct(float4 c, float2 r);
198float4x2 outerProduct(float2 c, float4 r);
199float3x4 outerProduct(float4 c, float3 r);
200float4x3 outerProduct(float3 c, float4 r);
201half2x2 outerProduct(half2 c, half2 r);
202half3x3 outerProduct(half3 c, half3 r);
203half4x3 outerProduct(half4 c, half4 r);
204half2x3 outerProduct(half3 c, half2 r);
205half3x2 outerProduct(half2 c, half3 r);
206half2x4 outerProduct(half4 c, half2 r);
207half4x2 outerProduct(half2 c, half4 r);
208half3x4 outerProduct(half4 c, half3 r);
209half4x3 outerProduct(half3 c, half4 r);
210float2x2 transpose(float2x2 m);
211float3x3 transpose(float3x3 m);
212float4x4 transpose(float4x4 m);
213float2x3 transpose(float3x2 m);
214float3x2 transpose(float2x3 m);
215float2x4 transpose(float4x2 m);
216float4x2 transpose(float2x4 m);
217float3x4 transpose(float4x3 m);
218float4x3 transpose(float3x4 m);
219half2x2 transpose(half2x2 m);
220half3x3 transpose(half3x3 m);
221half4x4 transpose(half4x4 m);
222half2x3 transpose(half3x2 m);
223half3x2 transpose(half2x3 m);
224half2x4 transpose(half4x2 m);
225half4x2 transpose(half2x4 m);
226half3x4 transpose(half4x3 m);
227half4x3 transpose(half3x4 m);
228float determinant(float2x2 m);
229float determinant(float3x3 m);
230float determinant(float4x4 m);
231half determinant(half2x2 m);
232half determinant(half3x3 m);
233half determinant(half4x4 m);
234float2x2 inverse(float2x2 m);
235float3x3 inverse(float3x3 m);
236float4x4 inverse(float4x4 m);
237half2x2 inverse(half2x2 m);
238half3x3 inverse(half3x3 m);
239half4x4 inverse(half4x4 m);
240$bvec lessThan($vec x, $vec y);
241$bvec lessThan($hvec x, $hvec y);
242$bvec lessThan($dvec x, $dvec y);
243$bvec lessThan($ivec x, $ivec y);
244$bvec lessThan($svec x, $svec y);
245$bvec lessThan($usvec x, $usvec y);
246$bvec lessThan($uvec x, $uvec y);
247$bvec lessThanEqual($vec x, $vec y);
248$bvec lessThanEqual($hvec x, $hvec y);
249$bvec lessThanEqual($dvec x, $dvec y);
250$bvec lessThanEqual($ivec x, $ivec y);
251$bvec lessThanEqual($uvec x, $uvec y);
252$bvec lessThanEqual($svec x, $svec y);
253$bvec lessThanEqual($usvec x, $usvec y);
254$bvec greaterThan($vec x, $vec y);
255$bvec greaterThan($hvec x, $hvec y);
256$bvec greaterThan($dvec x, $dvec y);
257$bvec greaterThan($ivec x, $ivec y);
258$bvec greaterThan($uvec x, $uvec y);
259$bvec greaterThan($svec x, $svec y);
260$bvec greaterThan($usvec x, $usvec y);
261$bvec greaterThanEqual($vec x, $vec y);
262$bvec greaterThanEqual($hvec x, $hvec y);
263$bvec greaterThanEqual($dvec x, $dvec y);
264$bvec greaterThanEqual($ivec x, $ivec y);
265$bvec greaterThanEqual($uvec x, $uvec y);
266$bvec greaterThanEqual($svec x, $svec y);
267$bvec greaterThanEqual($usvec x, $usvec y);
268$bvec equal($vec x, $vec y);
269$bvec equal($hvec x, $hvec y);
270$bvec equal($dvec x, $dvec y);
271$bvec equal($ivec x, $ivec y);
272$bvec equal($uvec x, $uvec y);
273$bvec equal($svec x, $svec y);
274$bvec equal($usvec x, $usvec y);
275$bvec equal($bvec x, $bvec y);
276$bvec notEqual($vec x, $vec y);
277$bvec notEqual($hvec x, $hvec y);
278$bvec notEqual($dvec x, $dvec y);
279$bvec notEqual($ivec x, $ivec y);
280$bvec notEqual($uvec x, $uvec y);
281$bvec notEqual($svec x, $svec y);
282$bvec notEqual($usvec x, $usvec y);
283$bvec notEqual($bvec x, $bvec y);
284bool any($bvec x);
285bool all($bvec x);
286$bvec not($bvec x);
287
288$genIType bitCount($genIType value);
289$genIType bitCount($genUType value);
290$genIType findLSB($genIType value);
291$genIType findLSB($genUType value);
292$genIType findMSB($genIType value);
293$genIType findMSB($genUType value);
294
295/*
296//$genUType uaddCarry($genUType x, $genUType y, out $genUType carry);
297//$genUType usubBorrow($genUType x, $genUType y, out $genUType borrow);
298void umulExtended($genUType x, $genUType y, out $genUType msb, out $genUType lsb);
299void imulExtended($genIType x, $genIType y, out $genIType msb, out $genIType lsb);
300$genIType bitfieldExtract($genIType value, int offset, int bits);
301//$genUType bitfieldExtract($genUType value, int offset, int bits);
302$genIType bitfieldInsert($genIType base, $genIType insert, int offset, int bits);
303//$genUType bitfieldInsert($genUType base, $genUType insert, int offset, int bits);
304$genIType bitfieldReverse($genIType value);
305//$genUType bitfieldReverse($genUType value);
306int textureSize($gsampler1D sampler, int lod);
307int2 textureSize($gsampler2D sampler, int lod);
308int3 textureSize($gsampler3D sampler, int lod);
309int2 textureSize($gsamplerCube sampler, int lod);
310int textureSize(sampler1DShadow sampler, int lod);
311int2 textureSize(sampler2DShadow sampler, int lod);
312int2 textureSize(samplerCubeShadow sampler, int lod);
313int3 textureSize($gsamplerCubeArray sampler, int lod);
314int3 textureSize(samplerCubeArrayShadow sampler, int lod);
315*/
316int2 textureSize($gsampler2DRect sampler);
317/*
318int2 textureSize(sampler2DRectShadow sampler);
319int2 textureSize($gsampler1DArray sampler, int lod);
320int3 textureSize($gsampler2DArray sampler, int lod);
321int2 textureSize(sampler1DArrayShadow sampler, int lod);
322int3 textureSize(sampler2DArrayShadow sampler, int lod);
323int textureSize($gsamplerBuffer sampler);
324int2 textureSize($gsampler2DMS sampler);
325int3 textureSize($gsampler2DMSArray sampler);
326float2 textureQueryLod($gsampler1D sampler, float P);
327float2 textureQueryLod($gsampler2D sampler, float2 P);
328float2 textureQueryLod($gsampler3D sampler, float3 P);
329float2 textureQueryLod($gsamplerCube sampler, float3 P);
330float2 textureQueryLod($gsampler1DArray sampler, float P);
331float2 textureQueryLod($gsampler2DArray sampler, float2 P);
332float2 textureQueryLod($gsamplerCubeArray sampler, float3 P);
333float2 textureQueryLod(sampler1DShadow sampler, float P);
334float2 textureQueryLod(sampler2DShadow sampler, float2 P);
335float2 textureQueryLod(samplerCubeShadow sampler, float3 P);
336float2 textureQueryLod(sampler1DArrayShadow sampler, float P);
337float2 textureQueryLod(sampler2DArrayShadow sampler, float2 P);
338float2 textureQueryLod(samplerCubeArrayShadow sampler, float3 P);
339int textureQueryLevels($gsampler1D sampler);
340int textureQueryLevels($gsampler2D sampler);
341int textureQueryLevels($gsampler3D sampler);
342int textureQueryLevels($gsamplerCube sampler);
343int textureQueryLevels($gsampler1DArray sampler);
344int textureQueryLevels($gsampler2DArray sampler);
345int textureQueryLevels($gsamplerCubeArray sampler);
346int textureQueryLevels(sampler1DShadow sampler);
347int textureQueryLevels(sampler2DShadow sampler);
348int textureQueryLevels(samplerCubeShadow sampler);
349int textureQueryLevels(sampler1DArrayShadow sampler);
350int textureQueryLevels(sampler2DArrayShadow sampler);
351int textureQueryLevels(samplerCubeArrayShadow sampler);
352*/
353
354half4 texture($gsampler1D sampler, float P);
355half4 texture($gsampler1D sampler, float P, float bias);
356half4 texture($gsampler2D sampler, float2 P);
357// The above currently only expand to handle the float/fixed case. So we also declare this integer
358// version of texture().
359int4 texture(isampler2D sampler, float2 P);
360half4 texture(samplerExternalOES sampler, float2 P, float bias);
361half4 texture(samplerExternalOES sampler, float2 P);
362
363/*
364$gfloat4 texture($gsampler2D sampler, float2 P, float bias);
365$gfloat4 texture($gsampler3D sampler, float3 P);
366$gfloat4 texture($gsampler3D sampler, float3 P, float bias);
367$gfloat4 texture($gsamplerCube sampler, float3 P);
368$gfloat4 texture($gsamplerCube sampler, float3 P, float bias);
369float texture(sampler1DShadow sampler, float3 P);
370float texture(sampler1DShadow sampler, float3 P, float bias);
371float texture(sampler2DShadow sampler, float3 P);
372float texture(sampler2DShadow sampler, float3 P, float bias);
373float texture(samplerCubeShadow sampler, float4 P);
374float texture(samplerCubeShadow sampler, float4 P, float bias);
375$gfloat4 texture($gsampler1DArray sampler, float2 P);
376$gfloat4 texture($gsampler1DArray sampler, float2 P, float bias);
377$gfloat4 texture($gsampler2DArray sampler, float3 P);
378$gfloat4 texture($gsampler2DArray sampler, float3 P, float bias);
379$gfloat4 texture($gsamplerCubeArray sampler, float4 P);
380$gfloat4 texture($gsamplerCubeArray sampler, float4 P, float bias);
381float texture(sampler1DArrayShadow sampler, float3 P);
382float texture(sampler1DArrayShadow sampler, float3 P, float bias);
383float texture(sampler2DArrayShadow sampler, float4 P);
384*/
385
386half4 texture($gsampler2DRect sampler, float2 P);
387half4 texture($gsampler2DRect sampler, float3 P);
388
389/*
390float texture(sampler2DRectShadow sampler, float3 P);
391float texture($gsamplerCubeArrayShadow sampler, float4 P, float compare);
392*/
393
394// Currently we do not support the generic types of loading subpassInput so we have some explicit
395// versions that we currently use
396float4 subpassLoad(subpassInput subpass);
397float4 subpassLoad(subpassInputMS subpass, int sample);
398/*
399$gfloat4subpassLoad(gsubpassInput subpass);
400$gfloat4subpassLoad(gsubpassInputMS subpass, int sample);
401*/
402)
403
404// split into multiple chunks, as MSVC++ complains if a single string is too long
405
406STRINGIFY(
407
408half4 texture($gsampler1D sampler, float2 P);
409half4 texture($gsampler1D sampler, float2 P, float bias);
410half4 texture($gsampler2D sampler, float3 P);
411half4 texture($gsampler2D sampler, float3 P, float bias);
412/*
413$gfloat4 textureProj($gsampler3D sampler, float4 P);
414$gfloat4 textureProj($gsampler3D sampler, float4 P, float bias);
415float textureProj(sampler1DShadow sampler, float4 P);
416float textureProj(sampler1DShadow sampler, float4 P, float bias);
417float textureProj(sampler2DShadow sampler, float4 P);
418float textureProj(sampler2DShadow sampler, float4 P, float bias);
419$gfloat4 textureProj($gsampler2DRect sampler, float4 P);
420float textureProj(sampler2DRectShadow sampler, float4 P);
421$gfloat4 textureLod($gsampler1D sampler, float P, float lod);
422$gfloat4 textureLod($gsampler2D sampler, float2 P, float lod);
423$gfloat4 textureLod($gsampler3D sampler, float3 P, float lod);
424$gfloat4 textureLod($gsamplerCube sampler, float3 P, float lod);
425float textureLod(sampler1DShadow sampler, float3 P, float lod);
426float textureLod(sampler2DShadow sampler, float3 P, float lod);
427$gfloat4 textureLod($gsampler1DArray sampler, float2 P, float lod);
428$gfloat4 textureLod($gsampler2DArray sampler, float3 P, float lod);
429float textureLod(sampler1DArrayShadow sampler, float3 P, float lod);
430$gfloat4 textureLod($gsamplerCubeArray sampler, float4 P, float lod);
431$gfloat4 textureOffset($gsampler1D sampler, float P, int offset);
432$gfloat4 textureOffset($gsampler1D sampler, float P, int offset, float bias);
433$gfloat4 textureOffset($gsampler2D sampler, float2 P, int2 offset);
434$gfloat4 textureOffset($gsampler2D sampler, float2 P, int2 offset, float bias);
435$gfloat4 textureOffset($gsampler3D sampler, float3 P, int3 offset);
436$gfloat4 textureOffset($gsampler3D sampler, float3 P, int3 offset, float bias);
437$gfloat4 textureOffset($gsampler2DRect sampler, float2 P, int2 offset);
438float textureOffset(sampler2DRectShadow sampler, float3 P, int2 offset);
439float textureOffset(sampler1DShadow sampler, float3 P, int offset);
440float textureOffset(sampler1DShadow sampler, float3 P, int offset, float bias);
441float textureOffset(sampler2DShadow sampler, float3 P, int2 offset);
442float textureOffset(sampler2DShadow sampler, float3 P, int2 offset, float bias);
443$gfloat4 textureOffset($gsampler1DArray sampler, float2 P, int offset);
444$gfloat4 textureOffset($gsampler1DArray sampler, float2 P, int offset, float bias);
445$gfloat4 textureOffset($gsampler2DArray sampler, float3 P, int2 offset);
446$gfloat4 textureOffset($gsampler2DArray sampler, float3 P, int2 offset, float bias);
447float textureOffset(sampler1DArrayShadow sampler, float3 P, int offset);
448float textureOffset(sampler1DArrayShadow sampler, float3 P, int offset, float bias);
449float textureOffset(sampler2DArrayShadow sampler, float4 P, int2 offset);
450float4 texelFetch(samplerBuffer sampler, int P);
451$gfloat4 texelFetch($gsampler1D sampler, int P, int lod);
452$gfloat4 texelFetch($gsampler2D sampler, int2 P, int lod);
453$gfloat4 texelFetch($gsampler2DRect sampler, int2 P);
454$gfloat4 texelFetch($gsampler3D sampler, int3 P, int lod);
455$gfloat4 texelFetch($gsampler1DArray sampler, int2 P, int lod);
456$gfloat4 texelFetch($gsampler2DArray sampler, int3 P, int lod);
457$gfloat4 texelFetch($gsampler2DMS sampler, int2 P, int sample);
458$gfloat4 texelFetch($gsampler2DMSArray sampler, int3 P, int sample);
459$gfloat4 texelFetchOffset($gsampler1D sampler, int P, int lod, int offset);
460$gfloat4 texelFetchOffset($gsampler2D sampler, int2 P, int lod, int2 offset);
461$gfloat4 texelFetchOffset($gsampler3D sampler, int3 P, int lod, int3 offset);
462$gfloat4 texelFetchOffset($gsampler2DRect sampler, int2 P, int2 offset);
463$gfloat4 texelFetchOffset($gsampler1DArray sampler, int2 P, int lod, int offset);
464$gfloat4 texelFetchOffset($gsampler2DArray sampler, int3 P, int lod, int2 offset);
465$gfloat4 textureProjOffset($gsampler1D sampler, float2 P, int offset);
466$gfloat4 textureProjOffset($gsampler1D sampler, float2 P, int offset, float bias);
467$gfloat4 textureProjOffset($gsampler1D sampler, float4 P, int offset);
468$gfloat4 textureProjOffset($gsampler1D sampler, float4 P, int offset, float bias);
469$gfloat4 textureProjOffset($gsampler2D sampler, float3 P, int2 offset);
470$gfloat4 textureProjOffset($gsampler2D sampler, float3 P, int2 offset, float bias);
471$gfloat4 textureProjOffset($gsampler2D sampler, float4 P, int2 offset);
472$gfloat4 textureProjOffset($gsampler2D sampler, float4 P, int2 offset, float bias);
473$gfloat4 textureProjOffset($gsampler3D sampler, float4 P, int3 offset);
474$gfloat4 textureProjOffset($gsampler3D sampler, float4 P, int3 offset, float bias);
475$gfloat4 textureProjOffset($gsampler2DRect sampler, float3 P, int2 offset);
476$gfloat4 textureProjOffset($gsampler2DRect sampler, float4 P, int2 offset);
477float textureProjOffset(sampler2DRectShadow sampler, float4 P, int2 offset);
478float textureProjOffset(sampler1DShadow sampler, float4 P, int offset);
479float textureProjOffset(sampler1DShadow sampler, float4 P, int offset, float bias);
480float textureProjOffset(sampler2DShadow sampler, float4 P, int2 offset);
481float textureProjOffset(sampler2DShadow sampler, float4 P, int2 offset, float bias);
482$gfloat4 textureLodOffset($gsampler1D sampler, float P, float lod, int offset);
483$gfloat4 textureLodOffset($gsampler2D sampler, float2 P, float lod, int2 offset);
484$gfloat4 textureLodOffset($gsampler3D sampler, float3 P, float lod, int3 offset);
485float textureLodOffset(sampler1DShadow sampler, float3 P, float lod, int offset);
486float textureLodOffset(sampler2DShadow sampler, float3 P, float lod, int2 offset);
487$gfloat4 textureLodOffset($gsampler1DArray sampler, float2 P, float lod, int offset);
488$gfloat4 textureLodOffset($gsampler2DArray sampler, float3 P, float lod, int2 offset);
489float textureLodOffset(sampler1DArrayShadow sampler, float3 P, float lod, int offset);
490$gfloat4 textureProjLod($gsampler1D sampler, float2 P, float lod);
491$gfloat4 textureProjLod($gsampler1D sampler, float4 P, float lod);
492$gfloat4 textureProjLod($gsampler2D sampler, float3 P, float lod);
493$gfloat4 textureProjLod($gsampler2D sampler, float4 P, float lod);
494$gfloat4 textureProjLod($gsampler3D sampler, float4 P, float lod);
495float textureProjLod(sampler1DShadow sampler, float4 P, float lod);
496float textureProjLod(sampler2DShadow sampler, float4 P, float lod);
497$gfloat4 textureProjLodOffset($gsampler1D sampler, float2 P, float lod, int offset);
498$gfloat4 textureProjLodOffset($gsampler1D sampler, float4 P, float lod, int offset);
499$gfloat4 textureProjLodOffset($gsampler2D sampler, float3 P, float lod, int2 offset);
500$gfloat4 textureProjLodOffset($gsampler2D sampler, float4 P, float lod, int2 offset);
501$gfloat4 textureProjLodOffset($gsampler3D sampler, float4 P, float lod, int3 offset);
502float textureProjLodOffset(sampler1DShadow sampler, float4 P, float lod, int offset);
503float textureProjLodOffset(sampler2DShadow sampler, float4 P, float lod, int2 offset);
504$gfloat4 textureGrad($gsampler1D sampler, float P, float dPdx, float dPdy);
505$gfloat4 textureGrad($gsampler2D sampler, float2 P, float2 dPdx, float2 dPdy);
506$gfloat4 textureGrad($gsampler3D sampler, float3 P, float3 dPdx, float3 dPdy);
507$gfloat4 textureGrad($gsamplerCube sampler, float3 P, float3 dPdx, float3 dPdy);
508$gfloat4 textureGrad($gsampler2DRect sampler, float2 P, float2 dPdx, float2 dPdy);
509float textureGrad(sampler2DRectShadow sampler, float3 P, float2 dPdx, float2 dPdy);
510float textureGrad(sampler1DShadow sampler, float3 P, float dPdx, float dPdy);
511float textureGrad(sampler2DShadow sampler, float3 P, float2 dPdx, float2 dPdy);
512float textureGrad(samplerCubeShadow sampler, float4 P, float3 dPdx, float3 dPdy);
513$gfloat4 textureGrad($gsampler1DArray sampler, float2 P, float dPdx, float dPdy);
514$gfloat4 textureGrad($gsampler2DArray sampler, float3 P, float2 dPdx, float2 dPdy);
515float textureGrad(sampler1DArrayShadow sampler, float3 P, float dPdx, float dPdy);
516float textureGrad(sampler2DArrayShadow sampler, float4 P, float2 dPdx, float2 dPdy);
517$gfloat4 textureGrad($gsamplerCubeArray sampler, float4 P, float3 dPdx, float3 dPdy);
518$gfloat4 textureGradOffset($gsampler1D sampler, float P, float dPdx, float dPdy, int offset);
519$gfloat4 textureGradOffset($gsampler2D sampler, float2 P, float2 dPdx, float2 dPdy, int2 offset);
520$gfloat4 textureGradOffset($gsampler3D sampler, float3 P, float3 dPdx, float3 dPdy, int3 offset);
521$gfloat4 textureGradOffset($gsampler2DRect sampler, float2 P, float2 dPdx, float2 dPdy, int2 offset);
522float textureGradOffset(sampler2DRectShadow sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
523float textureGradOffset(sampler1DShadow sampler, float3 P, float dPdx, float dPdy, int offset );
524float textureGradOffset(sampler2DShadow sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
525$gfloat4 textureGradOffset($gsampler1DArray sampler, float2 P, float dPdx, float dPdy, int offset);
526$gfloat4 textureGradOffset($gsampler2DArray sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
527float textureGradOffset(sampler1DArrayShadow sampler, float3 P, float dPdx, float dPdy, int offset);
528float textureGradOffset(sampler2DArrayShadow sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
529$gfloat4 textureProjGrad($gsampler1D sampler, float2 P, float dPdx, float dPdy);
530$gfloat4 textureProjGrad($gsampler1D sampler, float4 P, float dPdx, float dPdy);
531$gfloat4 textureProjGrad($gsampler2D sampler, float3 P, float2 dPdx, float2 dPdy);
532$gfloat4 textureProjGrad($gsampler2D sampler, float4 P, float2 dPdx, float2 dPdy);
533$gfloat4 textureProjGrad($gsampler3D sampler, float4 P, float3 dPdx, float3 dPdy);
534$gfloat4 textureProjGrad($gsampler2DRect sampler, float3 P, float2 dPdx, float2 dPdy);
535$gfloat4 textureProjGrad($gsampler2DRect sampler, float4 P, float2 dPdx, float2 dPdy);
536float textureProjGrad(sampler2DRectShadow sampler, float4 P, float2 dPdx, float2 dPdy);
537float textureProjGrad(sampler1DShadow sampler, float4 P, float dPdx, float dPdy);
538float textureProjGrad(sampler2DShadow sampler, float4 P, float2 dPdx, float2 dPdy);
539$gfloat4 textureProjGradOffset($gsampler1D sampler, float2 P, float dPdx, float dPdy, int offset);
540$gfloat4 textureProjGradOffset($gsampler1D sampler, float4 P, float dPdx, float dPdy, int offset);
541$gfloat4 textureProjGradOffset($gsampler2D sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
542$gfloat4 textureProjGradOffset($gsampler2D sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
543$gfloat4 textureProjGradOffset($gsampler2DRect sampler, float3 P, float2 dPdx, float2 dPdy, int2 offset);
544$gfloat4 textureProjGradOffset($gsampler2DRect sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
545float textureProjGradOffset(sampler2DRectShadow sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
546$gfloat4 textureProjGradOffset($gsampler3D sampler, float4 P, float3 dPdx, float3 dPdy, int3 offset);
547float textureProjGradOffset(sampler1DShadow sampler, float4 P, float dPdx, float dPdy, int offset);
548float textureProjGradOffset(sampler2DShadow sampler, float4 P, float2 dPdx, float2 dPdy, int2 offset);
549$gfloat4 textureGather($gsampler2D sampler, float2 P);
550$gfloat4 textureGather($gsampler2D sampler, float2 P, int comp);
551$gfloat4 textureGather($gsampler2DArray sampler, float3 P);
552$gfloat4 textureGather($gsampler2DArray sampler, float3 P, int comp);
553$gfloat4 textureGather($gsamplerCube sampler, float3 P);
554$gfloat4 textureGather($gsamplerCube sampler, float3 P, int comp);
555$gfloat4 textureGather($gsamplerCubeArray sampler, float4 P);
556$gfloat4 textureGather($gsamplerCubeArray sampler, float4 P, int comp);
557$gfloat4 textureGather($gsampler2DRect sampler, float2 P);
558$gfloat4 textureGather($gsampler2DRect sampler, float2 P, int comp);
559float4 textureGather(sampler2DShadow sampler, float2 P, float refZ);
560float4 textureGather(sampler2DArrayShadow sampler, float3 P, float refZ);
561float4 textureGather(samplerCubeShadow sampler, float3 P, float refZ);
562float4 textureGather(samplerCubeArrayShadow sampler, float4 P, float refZ);
563float4 textureGather(sampler2DRectShadow sampler, float2 P, float refZ);
564$gfloat4 textureGatherOffset($gsampler2D sampler, float2 P, int2 offset);
565$gfloat4 textureGatherOffset($gsampler2D sampler, float2 P, int2 offset, int comp);
566$gfloat4 textureGatherOffset($gsampler2DArray sampler, float3 P, int2 offset);
567$gfloat4 textureGatherOffset($gsampler2DArray sampler, float3 P, int2 offset, int comp);
568$gfloat4 textureGatherOffset($gsampler2DRect sampler, float2 P, int2 offset);
569$gfloat4 textureGatherOffset($gsampler2DRect sampler, float2 P, int2 offset, int comp);
570float4 textureGatherOffset(sampler2DShadow sampler, float2 P, float refZ, int2 offset);
571float4 textureGatherOffset(sampler2DArrayShadow sampler, float3 P, float refZ, int2 offset);
572float4 textureGatherOffset(sampler2DRectShadow sampler, float2 P, float refZ, int2 offset);
573$gfloat4 textureGatherOffsets($gsampler2D sampler, float2 P, int2 offsets[4]);
574$gfloat4 textureGatherOffsets($gsampler2D sampler, float2 P, int2 offsets[4], int comp);
575$gfloat4 textureGatherOffsets($gsampler2DArray sampler, float3 P, int2 offsets[4]);
576$gfloat4 textureGatherOffsets($gsampler2DArray sampler, float3 P, int2 offsets[4], int comp);
577$gfloat4 textureGatherOffsets($gsampler2DRect sampler, float2 P, int2 offsets[4]);
578$gfloat4 textureGatherOffsets($gsampler2DRect sampler, float2 P, int2 offsets[4], int comp);
579float4 textureGatherOffsets(sampler2DShadow sampler, float2 P, float refZ, int2 offsets[4]);
580float4 textureGatherOffsets(sampler2DArrayShadow sampler, float3 P, float refZ, int2 offsets[4]);
581float4 textureGatherOffsets(sampler2DRectShadow sampler, float2 P, float refZ, int2 offsets[4]);
582uint atomicCounterIncrement(atomic_uint c);
583uint atomicCounter(atomic_uint c);
584uint atomicAdd(inout uint mem, uint data);
585int atomicAdd(inout int mem, int data);
586uint atomicMin(inout uint mem, uint data);
587int atomicMin(inout int mem, int data);
588uint atomicMax(inout uint mem, uint data);
589int atomicMax(inout int mem, int data);
590uint atomicAnd(inout uint mem, uint data);
591int atomicAnd(inout int mem, int data);
592uint atomicOr(inout uint mem, uint data);
593int atomicOr(inout int mem, int data);
594uint atomicXor(inout uint mem, uint data);
595int atomicXor(inout int mem, int data);
596uint atomicExchange(inout uint mem, uint data);
597int atomicExchange(inout int mem, int data);
598uint atomicCompSwap(inout uint mem, uint compare, uint data);
599int atomicCompSwap(inout int mem, int compare, int data);
600*/
601// section 8.12 Additional Image Functions will go here if and when we add
602// support for them
603float4 imageLoad(image2D image, int2 P);
604int4 imageLoad(iimage2D image, int2 P);
605$genType dFdx($genType p);
606$genType dFdy($genType p);
607$genHType dFdx($genHType p);
608$genHType dFdy($genHType p);
609$genType fwidth($genType p);
610$genHType fwidth($genHType p);
611float interpolateAtSample(float interpolant, int sample);
612float2 interpolateAtSample(float2 interpolant, int sample);
613float3 interpolateAtSample(float3 interpolant, int sample);
614float4 interpolateAtSample(float4 interpolant, int sample);
615float interpolateAtOffset(float interpolant, float2 offset);
616float2 interpolateAtOffset(float2 interpolant, float2 offset);
617float3 interpolateAtOffset(float3 interpolant, float2 offset);
618float4 interpolateAtOffset(float4 interpolant, float2 offset);
619
620/*
621$genType fwidth($genType p);
622$genType fwidthCoarse($genType p);
623$genType fwidthFine($genType p);
624void barrier();
625void memoryBarrier();
626void memoryBarrierAtomicCounter();
627void memoryBarrierBuffer();
628void memoryBarrierShared();
629void memoryBarrierImage();
630void groupMemoryBarrier();
631*/
632
633)
634