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