blob: bf35f22dbd87fa989320f384aa61dbb9b4b43bd2 [file] [log] [blame]
ethannicholasb3058bd2016-07-01 08:22:01 -07001STRINGIFY(
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$genDType fma($genDType a, $genDType b, $genDType c);
103$genType frexp($genType x, out $genIType exp);
104$genDType frexp($genDType x, out $genIType exp);
105$genType ldexp($genType x, in $genIType exp);
106$genDType ldexp($genDType x, in $genIType exp);
107uint packUnorm2x16(vec2 v);
108uint packSnorm2x16(vec2 v);
109uint packUnorm4x8(vec4 v);
110uint packSnorm4x8(vec4 v);
111vec2 unpackUnorm2x16(uint p);
112vec2 unpackSnorm2x16(uint p);
113vec4 unpackUnorm4x8(uint p);
114vec4 unpackSnorm4x8(uint p);
115double packDouble2x32(uvec2 v);
116uvec2 unpackDouble2x32(double v);
117uint packHalf2x16(vec2 v);
118vec2 unpackHalf2x16(uint v);
119float length($genType x);
120double length($genDType x);
121float distance($genType p0, $genType p1);
122double distance($genDType p0, $genDType p1);
123float dot($genType x, $genType y);
124double dot($genDType x, $genDType y);
125vec3 cross(vec3 x, vec3 y);
126dvec3 cross(dvec3 x, dvec3 y);
127$genType normalize($genType x);
128$genDType normalize($genDType x);
129vec4 ftransform();
130$genType faceforward($genType N, $genType I, $genType Nref);
131$genDType faceforward($genDType N, $genDType I, $genDType Nref);
132$genType reflect($genType I, $genType N);
133$genDType reflect($genDType I, $genDType N);
134$genType refract($genType I, $genType N, float eta);
135$genDType refract($genDType I, $genDType N, float eta);
136$mat matrixCompMult($mat x, $mat y);
137mat2 outerProduct(vec2 c, vec2 r);
138mat3 outerProduct(vec3 c, vec3 r);
139mat4 outerProduct(vec4 c, vec4 r);
140mat2x3 outerProduct(vec3 c, vec2 r);
141mat3x2 outerProduct(vec2 c, vec3 r);
142mat2x4 outerProduct(vec4 c, vec2 r);
143mat4x2 outerProduct(vec2 c, vec4 r);
144mat3x4 outerProduct(vec4 c, vec3 r);
145mat4x3 outerProduct(vec3 c, vec4 r);
146mat2 transpose(mat2 m);
147mat3 transpose(mat3 m);
148mat4 transpose(mat4 m);
149mat2x3 transpose(mat3x2 m);
150mat3x2 transpose(mat2x3 m);
151mat2x4 transpose(mat4x2 m);
152mat4x2 transpose(mat2x4 m);
153mat3x4 transpose(mat4x3 m);
154mat4x3 transpose(mat3x4 m);
155float determinant(mat2 m);
156float determinant(mat3 m);
157float determinant(mat4 m);
158mat2 inverse(mat2 m);
159mat3 inverse(mat3 m);
160mat4 inverse(mat4 m);
161$bvec lessThan($vec x, $vec y);
162$bvec lessThan($ivec x, $ivec y);
163$bvec lessThan($uvec x, $uvec y);
164$bvec lessThanEqual($vec x, $vec y);
165$bvec lessThanEqual($ivec x, $ivec y);
166$bvec lessThanEqual($uvec x, $uvec y);
167$bvec greaterThan($vec x, $vec y);
168$bvec greaterThan($ivec x, $ivec y);
169$bvec greaterThan($uvec x, $uvec y);
170$bvec greaterThanEqual($vec x, $vec y);
171$bvec greaterThanEqual($ivec x, $ivec y);
172$bvec greaterThanEqual($uvec x, $uvec y);
173$bvec equal($vec x, $vec y);
174$bvec equal($ivec x, $ivec y);
175$bvec equal($uvec x, $uvec y);
176$bvec equal($bvec x, $bvec y);
177$bvec notEqual($vec x, $vec y);
178$bvec notEqual($ivec x, $ivec y);
179$bvec notEqual($uvec x, $uvec y);
180$bvec notEqual($bvec x, $bvec y);
181bool any($bvec x);
182bool all($bvec x);
183$bvec not($bvec x);
184$genUType uaddCarry($genUType x, $genUType y, out $genUType carry);
185$genUType usubBorrow($genUType x, $genUType y, out $genUType borrow);
186void umulExtended($genUType x, $genUType y, out $genUType msb, out $genUType lsb);
187void imulExtended($genIType x, $genIType y, out $genIType msb, out $genIType lsb);
188$genIType bitfieldExtract($genIType value, int offset, int bits);
189$genUType bitfieldExtract($genUType value, int offset, int bits);
190$genIType bitfieldInsert($genIType base, $genIType insert, int offset, int bits);
191$genUType bitfieldInsert($genUType base, $genUType insert, int offset, int bits);
192$genIType bitfieldReverse($genIType value);
193$genUType bitfieldReverse($genUType value);
194$genIType bitCount($genIType value);
195$genIType bitCount($genUType value);
196$genIType findLSB($genIType value);
197$genIType findLSB($genUType value);
198$genIType findMSB($genIType value);
199$genIType findMSB($genUType value);
200int textureSize($gsampler1D sampler, int lod);
201ivec2 textureSize($gsampler2D sampler, int lod);
202ivec3 textureSize($gsampler3D sampler, int lod);
203ivec2 textureSize($gsamplerCube sampler, int lod);
204int textureSize(sampler1DShadow sampler, int lod);
205ivec2 textureSize(sampler2DShadow sampler, int lod);
206ivec2 textureSize(samplerCubeShadow sampler, int lod);
207ivec3 textureSize($gsamplerCubeArray sampler, int lod);
208ivec3 textureSize(samplerCubeArrayShadow sampler, int lod);
209ivec2 textureSize($gsampler2DRect sampler);
210ivec2 textureSize(sampler2DRectShadow sampler);
211ivec2 textureSize($gsampler1DArray sampler, int lod);
212ivec3 textureSize($gsampler2DArray sampler, int lod);
213ivec2 textureSize(sampler1DArrayShadow sampler, int lod);
214ivec3 textureSize(sampler2DArrayShadow sampler, int lod);
215int textureSize($gsamplerBuffer sampler);
216ivec2 textureSize($gsampler2DMS sampler);
217ivec3 textureSize($gsampler2DMSArray sampler);
218vec2 textureQueryLod($gsampler1D sampler, float P);
219vec2 textureQueryLod($gsampler2D sampler, vec2 P);
220vec2 textureQueryLod($gsampler3D sampler, vec3 P);
221vec2 textureQueryLod($gsamplerCube sampler, vec3 P);
222vec2 textureQueryLod($gsampler1DArray sampler, float P);
223vec2 textureQueryLod($gsampler2DArray sampler, vec2 P);
224vec2 textureQueryLod($gsamplerCubeArray sampler, vec3 P);
225vec2 textureQueryLod(sampler1DShadow sampler, float P);
226vec2 textureQueryLod(sampler2DShadow sampler, vec2 P);
227vec2 textureQueryLod(samplerCubeShadow sampler, vec3 P);
228vec2 textureQueryLod(sampler1DArrayShadow sampler, float P);
229vec2 textureQueryLod(sampler2DArrayShadow sampler, vec2 P);
230vec2 textureQueryLod(samplerCubeArrayShadow sampler, vec3 P);
231int textureQueryLevels($gsampler1D sampler);
232int textureQueryLevels($gsampler2D sampler);
233int textureQueryLevels($gsampler3D sampler);
234int textureQueryLevels($gsamplerCube sampler);
235int textureQueryLevels($gsampler1DArray sampler);
236int textureQueryLevels($gsampler2DArray sampler);
237int textureQueryLevels($gsamplerCubeArray sampler);
238int textureQueryLevels(sampler1DShadow sampler);
239int textureQueryLevels(sampler2DShadow sampler);
240int textureQueryLevels(samplerCubeShadow sampler);
241int textureQueryLevels(sampler1DArrayShadow sampler);
242int textureQueryLevels(sampler2DArrayShadow sampler);
243int textureQueryLevels(samplerCubeArrayShadow sampler);
244$gvec4 texture($gsampler1D sampler, float P);
245$gvec4 texture($gsampler1D sampler, float P, float bias);
246$gvec4 texture($gsampler2D sampler, vec2 P);
247$gvec4 texture($gsampler2D sampler, vec2 P, float bias);
248$gvec4 texture($gsampler3D sampler, vec3 P);
249$gvec4 texture($gsampler3D sampler, vec3 P, float bias);
250$gvec4 texture($gsamplerCube sampler, vec3 P);
251$gvec4 texture($gsamplerCube sampler, vec3 P, float bias);
252float texture(sampler1DShadow sampler, vec3 P);
253float texture(sampler1DShadow sampler, vec3 P, float bias);
254float texture(sampler2DShadow sampler, vec3 P);
255float texture(sampler2DShadow sampler, vec3 P, float bias);
256float texture(samplerCubeShadow sampler, vec4 P);
257float texture(samplerCubeShadow sampler, vec4 P, float bias);
258$gvec4 texture($gsampler1DArray sampler, vec2 P);
259$gvec4 texture($gsampler1DArray sampler, vec2 P, float bias);
260$gvec4 texture($gsampler2DArray sampler, vec3 P);
261$gvec4 texture($gsampler2DArray sampler, vec3 P, float bias);
262$gvec4 texture($gsamplerCubeArray sampler, vec4 P);
263$gvec4 texture($gsamplerCubeArray sampler, vec4 P, float bias);
264float texture(sampler1DArrayShadow sampler, vec3 P);
265float texture(sampler1DArrayShadow sampler, vec3 P, float bias);
266float texture(sampler2DArrayShadow sampler, vec4 P);
267$gvec4 texture($gsampler2DRect sampler, vec2 P);
268float texture(sampler2DRectShadow sampler, vec3 P);
269float texture($gsamplerCubeArrayShadow sampler, vec4 P, float compare);
270
271)
272
273// split into multiple chunks, as MSVC++ complains if a single string is too long
274
275STRINGIFY(
276
277$gvec4 textureProj($gsampler1D sampler, vec2 P);
278$gvec4 textureProj($gsampler1D sampler, vec2 P, float bias);
279$gvec4 textureProj($gsampler1D sampler, vec4 P);
280$gvec4 textureProj($gsampler1D sampler, vec4 P, float bias);
281$gvec4 textureProj($gsampler2D sampler, vec3 P);
282$gvec4 textureProj($gsampler2D sampler, vec3 P, float bias);
283$gvec4 textureProj($gsampler2D sampler, vec4 P);
284$gvec4 textureProj($gsampler2D sampler, vec4 P, float bias);
285$gvec4 textureProj($gsampler3D sampler, vec4 P);
286$gvec4 textureProj($gsampler3D sampler, vec4 P, float bias);
287float textureProj(sampler1DShadow sampler, vec4 P);
288float textureProj(sampler1DShadow sampler, vec4 P, float bias);
289float textureProj(sampler2DShadow sampler, vec4 P);
290float textureProj(sampler2DShadow sampler, vec4 P, float bias);
291$gvec4 textureProj($gsampler2DRect sampler, vec3 P);
292$gvec4 textureProj($gsampler2DRect sampler, vec4 P);
293float textureProj(sampler2DRectShadow sampler, vec4 P);
294$gvec4 textureLod($gsampler1D sampler, float P, float lod);
295$gvec4 textureLod($gsampler2D sampler, vec2 P, float lod);
296$gvec4 textureLod($gsampler3D sampler, vec3 P, float lod);
297$gvec4 textureLod($gsamplerCube sampler, vec3 P, float lod);
298float textureLod(sampler1DShadow sampler, vec3 P, float lod);
299float textureLod(sampler2DShadow sampler, vec3 P, float lod);
300$gvec4 textureLod($gsampler1DArray sampler, vec2 P, float lod);
301$gvec4 textureLod($gsampler2DArray sampler, vec3 P, float lod);
302float textureLod(sampler1DArrayShadow sampler, vec3 P, float lod);
303$gvec4 textureLod($gsamplerCubeArray sampler, vec4 P, float lod);
304$gvec4 textureOffset($gsampler1D sampler, float P, int offset);
305$gvec4 textureOffset($gsampler1D sampler, float P, int offset, float bias);
306$gvec4 textureOffset($gsampler2D sampler, vec2 P, ivec2 offset);
307$gvec4 textureOffset($gsampler2D sampler, vec2 P, ivec2 offset, float bias);
308$gvec4 textureOffset($gsampler3D sampler, vec3 P, ivec3 offset);
309$gvec4 textureOffset($gsampler3D sampler, vec3 P, ivec3 offset, float bias);
310$gvec4 textureOffset($gsampler2DRect sampler, vec2 P, ivec2 offset);
311float textureOffset(sampler2DRectShadow sampler, vec3 P, ivec2 offset);
312float textureOffset(sampler1DShadow sampler, vec3 P, int offset);
313float textureOffset(sampler1DShadow sampler, vec3 P, int offset, float bias);
314float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset);
315float textureOffset(sampler2DShadow sampler, vec3 P, ivec2 offset, float bias);
316$gvec4 textureOffset($gsampler1DArray sampler, vec2 P, int offset);
317$gvec4 textureOffset($gsampler1DArray sampler, vec2 P, int offset, float bias);
318$gvec4 textureOffset($gsampler2DArray sampler, vec3 P, ivec2 offset);
319$gvec4 textureOffset($gsampler2DArray sampler, vec3 P, ivec2 offset, float bias);
320float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset);
321float textureOffset(sampler1DArrayShadow sampler, vec3 P, int offset, float bias);
322float textureOffset(sampler2DArrayShadow sampler, vec4 P, ivec2 offset);
323$gvec4 texelFetch($gsampler1D sampler, int P, int lod);
324$gvec4 texelFetch($gsampler2D sampler, ivec2 P, int lod);
325$gvec4 texelFetch($gsampler3D sampler, ivec3 P, int lod);
326$gvec4 texelFetch($gsampler2DRect sampler, ivec2 P);
327$gvec4 texelFetch($gsampler1DArray sampler, ivec2 P, int lod);
328$gvec4 texelFetch($gsampler2DArray sampler, ivec3 P, int lod);
329$gvec4 texelFetch($gsamplerBuffer sampler, int P);
330$gvec4 texelFetch($gsampler2DMS sampler, ivec2 P, int sample);
331$gvec4 texelFetch($gsampler2DMSArray sampler, ivec3 P, int sample);
332$gvec4 texelFetchOffset($gsampler1D sampler, int P, int lod, int offset);
333$gvec4 texelFetchOffset($gsampler2D sampler, ivec2 P, int lod, ivec2 offset);
334$gvec4 texelFetchOffset($gsampler3D sampler, ivec3 P, int lod, ivec3 offset);
335$gvec4 texelFetchOffset($gsampler2DRect sampler, ivec2 P, ivec2 offset);
336$gvec4 texelFetchOffset($gsampler1DArray sampler, ivec2 P, int lod, int offset);
337$gvec4 texelFetchOffset($gsampler2DArray sampler, ivec3 P, int lod, ivec2 offset);
338$gvec4 textureProjOffset($gsampler1D sampler, vec2 P, int offset);
339$gvec4 textureProjOffset($gsampler1D sampler, vec2 P, int offset, float bias);
340$gvec4 textureProjOffset($gsampler1D sampler, vec4 P, int offset);
341$gvec4 textureProjOffset($gsampler1D sampler, vec4 P, int offset, float bias);
342$gvec4 textureProjOffset($gsampler2D sampler, vec3 P, ivec2 offset);
343$gvec4 textureProjOffset($gsampler2D sampler, vec3 P, ivec2 offset, float bias);
344$gvec4 textureProjOffset($gsampler2D sampler, vec4 P, ivec2 offset);
345$gvec4 textureProjOffset($gsampler2D sampler, vec4 P, ivec2 offset, float bias);
346$gvec4 textureProjOffset($gsampler3D sampler, vec4 P, ivec3 offset);
347$gvec4 textureProjOffset($gsampler3D sampler, vec4 P, ivec3 offset, float bias);
348$gvec4 textureProjOffset($gsampler2DRect sampler, vec3 P, ivec2 offset);
349$gvec4 textureProjOffset($gsampler2DRect sampler, vec4 P, ivec2 offset);
350float textureProjOffset(sampler2DRectShadow sampler, vec4 P, ivec2 offset);
351float textureProjOffset(sampler1DShadow sampler, vec4 P, int offset);
352float textureProjOffset(sampler1DShadow sampler, vec4 P, int offset, float bias);
353float textureProjOffset(sampler2DShadow sampler, vec4 P, ivec2 offset);
354float textureProjOffset(sampler2DShadow sampler, vec4 P, ivec2 offset, float bias);
355$gvec4 textureLodOffset($gsampler1D sampler, float P, float lod, int offset);
356$gvec4 textureLodOffset($gsampler2D sampler, vec2 P, float lod, ivec2 offset);
357$gvec4 textureLodOffset($gsampler3D sampler, vec3 P, float lod, ivec3 offset);
358float textureLodOffset(sampler1DShadow sampler, vec3 P, float lod, int offset);
359float textureLodOffset(sampler2DShadow sampler, vec3 P, float lod, ivec2 offset);
360$gvec4 textureLodOffset($gsampler1DArray sampler, vec2 P, float lod, int offset);
361$gvec4 textureLodOffset($gsampler2DArray sampler, vec3 P, float lod, ivec2 offset);
362float textureLodOffset(sampler1DArrayShadow sampler, vec3 P, float lod, int offset);
363$gvec4 textureProjLod($gsampler1D sampler, vec2 P, float lod);
364$gvec4 textureProjLod($gsampler1D sampler, vec4 P, float lod);
365$gvec4 textureProjLod($gsampler2D sampler, vec3 P, float lod);
366$gvec4 textureProjLod($gsampler2D sampler, vec4 P, float lod);
367$gvec4 textureProjLod($gsampler3D sampler, vec4 P, float lod);
368float textureProjLod(sampler1DShadow sampler, vec4 P, float lod);
369float textureProjLod(sampler2DShadow sampler, vec4 P, float lod);
370$gvec4 textureProjLodOffset($gsampler1D sampler, vec2 P, float lod, int offset);
371$gvec4 textureProjLodOffset($gsampler1D sampler, vec4 P, float lod, int offset);
372$gvec4 textureProjLodOffset($gsampler2D sampler, vec3 P, float lod, ivec2 offset);
373$gvec4 textureProjLodOffset($gsampler2D sampler, vec4 P, float lod, ivec2 offset);
374$gvec4 textureProjLodOffset($gsampler3D sampler, vec4 P, float lod, ivec3 offset);
375float textureProjLodOffset(sampler1DShadow sampler, vec4 P, float lod, int offset);
376float textureProjLodOffset(sampler2DShadow sampler, vec4 P, float lod, ivec2 offset);
377$gvec4 textureGrad($gsampler1D sampler, float P, float dPdx, float dPdy);
378$gvec4 textureGrad($gsampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy);
379$gvec4 textureGrad($gsampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy);
380$gvec4 textureGrad($gsamplerCube sampler, vec3 P, vec3 dPdx, vec3 dPdy);
381$gvec4 textureGrad($gsampler2DRect sampler, vec2 P, vec2 dPdx, vec2 dPdy);
382float textureGrad(sampler2DRectShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy);
383float textureGrad(sampler1DShadow sampler, vec3 P, float dPdx, float dPdy);
384float textureGrad(sampler2DShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy);
385float textureGrad(samplerCubeShadow sampler, vec4 P, vec3 dPdx, vec3 dPdy);
386$gvec4 textureGrad($gsampler1DArray sampler, vec2 P, float dPdx, float dPdy);
387$gvec4 textureGrad($gsampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy);
388float textureGrad(sampler1DArrayShadow sampler, vec3 P, float dPdx, float dPdy);
389float textureGrad(sampler2DArrayShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy);
390$gvec4 textureGrad($gsamplerCubeArray sampler, vec4 P, vec3 dPdx, vec3 dPdy);
391$gvec4 textureGradOffset($gsampler1D sampler, float P, float dPdx, float dPdy, int offset);
392$gvec4 textureGradOffset($gsampler2D sampler, vec2 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
393$gvec4 textureGradOffset($gsampler3D sampler, vec3 P, vec3 dPdx, vec3 dPdy, ivec3 offset);
394$gvec4 textureGradOffset($gsampler2DRect sampler, vec2 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
395float textureGradOffset(sampler2DRectShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
396float textureGradOffset(sampler1DShadow sampler, vec3 P, float dPdx, float dPdy, int offset );
397float textureGradOffset(sampler2DShadow sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
398$gvec4 textureGradOffset($gsampler1DArray sampler, vec2 P, float dPdx, float dPdy, int offset);
399$gvec4 textureGradOffset($gsampler2DArray sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
400float textureGradOffset(sampler1DArrayShadow sampler, vec3 P, float dPdx, float dPdy, int offset);
401float textureGradOffset(sampler2DArrayShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
402$gvec4 textureProjGrad($gsampler1D sampler, vec2 P, float dPdx, float dPdy);
403$gvec4 textureProjGrad($gsampler1D sampler, vec4 P, float dPdx, float dPdy);
404$gvec4 textureProjGrad($gsampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy);
405$gvec4 textureProjGrad($gsampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy);
406$gvec4 textureProjGrad($gsampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy);
407$gvec4 textureProjGrad($gsampler2DRect sampler, vec3 P, vec2 dPdx, vec2 dPdy);
408$gvec4 textureProjGrad($gsampler2DRect sampler, vec4 P, vec2 dPdx, vec2 dPdy);
409float textureProjGrad(sampler2DRectShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy);
410float textureProjGrad(sampler1DShadow sampler, vec4 P, float dPdx, float dPdy);
411float textureProjGrad(sampler2DShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy);
412$gvec4 textureProjGradOffset($gsampler1D sampler, vec2 P, float dPdx, float dPdy, int offset);
413$gvec4 textureProjGradOffset($gsampler1D sampler, vec4 P, float dPdx, float dPdy, int offset);
414$gvec4 textureProjGradOffset($gsampler2D sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
415$gvec4 textureProjGradOffset($gsampler2D sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
416$gvec4 textureProjGradOffset($gsampler2DRect sampler, vec3 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
417$gvec4 textureProjGradOffset($gsampler2DRect sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
418float textureProjGradOffset(sampler2DRectShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
419$gvec4 textureProjGradOffset($gsampler3D sampler, vec4 P, vec3 dPdx, vec3 dPdy, ivec3 offset);
420float textureProjGradOffset(sampler1DShadow sampler, vec4 P, float dPdx, float dPdy, int offset);
421float textureProjGradOffset(sampler2DShadow sampler, vec4 P, vec2 dPdx, vec2 dPdy, ivec2 offset);
422$gvec4 textureGather($gsampler2D sampler, vec2 P);
423$gvec4 textureGather($gsampler2D sampler, vec2 P, int comp);
424$gvec4 textureGather($gsampler2DArray sampler, vec3 P);
425$gvec4 textureGather($gsampler2DArray sampler, vec3 P, int comp);
426$gvec4 textureGather($gsamplerCube sampler, vec3 P);
427$gvec4 textureGather($gsamplerCube sampler, vec3 P, int comp);
428$gvec4 textureGather($gsamplerCubeArray sampler, vec4 P);
429$gvec4 textureGather($gsamplerCubeArray sampler, vec4 P, int comp);
430$gvec4 textureGather($gsampler2DRect sampler, vec2 P);
431$gvec4 textureGather($gsampler2DRect sampler, vec2 P, int comp);
432vec4 textureGather(sampler2DShadow sampler, vec2 P, float refZ);
433vec4 textureGather(sampler2DArrayShadow sampler, vec3 P, float refZ);
434vec4 textureGather(samplerCubeShadow sampler, vec3 P, float refZ);
435vec4 textureGather(samplerCubeArrayShadow sampler, vec4 P, float refZ);
436vec4 textureGather(sampler2DRectShadow sampler, vec2 P, float refZ);
437$gvec4 textureGatherOffset($gsampler2D sampler, vec2 P, ivec2 offset);
438$gvec4 textureGatherOffset($gsampler2D sampler, vec2 P, ivec2 offset, int comp);
439$gvec4 textureGatherOffset($gsampler2DArray sampler, vec3 P, ivec2 offset);
440$gvec4 textureGatherOffset($gsampler2DArray sampler, vec3 P, ivec2 offset, int comp);
441$gvec4 textureGatherOffset($gsampler2DRect sampler, vec2 P, ivec2 offset);
442$gvec4 textureGatherOffset($gsampler2DRect sampler, vec2 P, ivec2 offset, int comp);
443vec4 textureGatherOffset(sampler2DShadow sampler, vec2 P, float refZ, ivec2 offset);
444vec4 textureGatherOffset(sampler2DArrayShadow sampler, vec3 P, float refZ, ivec2 offset);
445vec4 textureGatherOffset(sampler2DRectShadow sampler, vec2 P, float refZ, ivec2 offset);
446/*
447$gvec4 textureGatherOffsets($gsampler2D sampler, vec2 P, ivec2 offsets[4]);
448$gvec4 textureGatherOffsets($gsampler2D sampler, vec2 P, ivec2 offsets[4], int comp);
449$gvec4 textureGatherOffsets($gsampler2DArray sampler, vec3 P, ivec2 offsets[4]);
450$gvec4 textureGatherOffsets($gsampler2DArray sampler, vec3 P, ivec2 offsets[4], int comp);
451$gvec4 textureGatherOffsets($gsampler2DRect sampler, vec2 P, ivec2 offsets[4]);
452$gvec4 textureGatherOffsets($gsampler2DRect sampler, vec2 P, ivec2 offsets[4], int comp);
453vec4 textureGatherOffsets(sampler2DShadow sampler, vec2 P, float refZ, ivec2 offsets[4]);
454vec4 textureGatherOffsets(sampler2DArrayShadow sampler, vec3 P, float refZ, ivec2 offsets[4]);
455vec4 textureGatherOffsets(sampler2DRectShadow sampler, vec2 P, float refZ, ivec2 offsets[4]);
456*/
457vec4 texture1D(sampler1D sampler, float coord);
458vec4 texture1D(sampler1D sampler, float coord, float bias);
459vec4 texture1DProj(sampler1D sampler, vec2 coord);
460vec4 texture1DProj(sampler1D sampler, vec2 coord, float bias);
461vec4 texture1DProj(sampler1D sampler, vec4 coord);
462vec4 texture1DProj(sampler1D sampler, vec4 coord, float bias);
463vec4 texture1DLod(sampler1D sampler, float coord, float lod);
464vec4 texture1DProjLod(sampler1D sampler, vec2 coord, float lod);
465vec4 texture1DProjLod(sampler1D sampler, vec4 coord, float lod);
466vec4 texture2D(sampler2D sampler, vec2 coord);
467vec4 texture2D(sampler2D sampler, vec2 coord, float bias);
468vec4 texture2DProj(sampler2D sampler, vec3 coord);
469vec4 texture2DProj(sampler2D sampler, vec3 coord, float bias);
470vec4 texture2DProj(sampler2D sampler, vec4 coord);
471vec4 texture2DProj(sampler2D sampler, vec4 coord, float bias);
472vec4 texture2DLod(sampler2D sampler, vec2 coord, float lod);
473vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod);
474vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod);
475vec4 texture3D(sampler3D sampler, vec3 coord);
476vec4 texture3D(sampler3D sampler, vec3 coord, float bias);
477vec4 texture3DProj(sampler3D sampler, vec4 coord);
478vec4 texture3DProj(sampler3D sampler, vec4 coord, float bias);
479vec4 texture3DLod(sampler3D sampler, vec3 coord, float lod);
480vec4 texture3DProjLod(sampler3D sampler, vec4 coord, float lod);
481vec4 textureCube(samplerCube sampler, vec3 coord);
482vec4 textureCube(samplerCube sampler, vec3 coord, float bias);
483vec4 textureCubeLod(samplerCube sampler, vec3 coord, float lod);
484vec4 shadow1D(sampler1DShadow sampler, vec3 coord);
485vec4 shadow1D(sampler1DShadow sampler, vec3 coord, float bias);
486vec4 shadow2D(sampler2DShadow sampler, vec3 coord);
487vec4 shadow2D(sampler2DShadow sampler, vec3 coord, float bias);
488vec4 shadow1DProj(sampler1DShadow sampler, vec4 coord);
489vec4 shadow1DProj(sampler1DShadow sampler, vec4 coord, float bias);
490vec4 shadow2DProj(sampler2DShadow sampler, vec4 coord);
491vec4 shadow2DProj(sampler2DShadow sampler, vec4 coord, float bias);
492vec4 shadow1DLod(sampler1DShadow sampler, vec3 coord, float lod);
493vec4 shadow2DLod(sampler2DShadow sampler, vec3 coord, float lod);
494vec4 shadow1DProjLod(sampler1DShadow sampler, vec4 coord, float lod);
495vec4 shadow2DProjLod(sampler2DShadow sampler, vec4 coord, float lod);
496/*
497uint atomicCounterIncrement(atomic_uint c);
498uint atomicCounter(atomic_uint c);
499uint atomicAdd(inout uint mem, uint data);
500int atomicAdd(inout int mem, int data);
501uint atomicMin(inout uint mem, uint data);
502int atomicMin(inout int mem, int data);
503uint atomicMax(inout uint mem, uint data);
504int atomicMax(inout int mem, int data);
505uint atomicAnd(inout uint mem, uint data);
506int atomicAnd(inout int mem, int data);
507uint atomicOr(inout uint mem, uint data);
508int atomicOr(inout int mem, int data);
509uint atomicXor(inout uint mem, uint data);
510int atomicXor(inout int mem, int data);
511uint atomicExchange(inout uint mem, uint data);
512int atomicExchange(inout int mem, int data);
513uint atomicCompSwap(inout uint mem, uint compare, uint data);
514int atomicCompSwap(inout int mem, int compare, int data);
515*/
516// section 8.12 Image Functions will go here if and when we add support for them
517
518$genType dFdx($genType p);
519$genType dFdy($genType p);
520$genType fwidth($genType p);
521$genType fwidthCoarse($genType p);
522$genType fwidthFine($genType p);
523float interpolateAtSample(float interpolant, int sample);
524vec2 interpolateAtSample(vec2 interpolant, int sample);
525vec3 interpolateAtSample(vec3 interpolant, int sample);
526vec4 interpolateAtSample(vec4 interpolant, int sample);
527float interpolateAtOffset(float interpolant, vec2 offset);
528vec2 interpolateAtOffset(vec2 interpolant, vec2 offset);
529vec3 interpolateAtOffset(vec3 interpolant, vec2 offset);
530vec4 interpolateAtOffset(vec4 interpolant, vec2 offset);
531void EmitStreamVertex(int stream);
532void EndStreamPrimitive(int stream);
533void EmitVertex();
534void EndPrimitive();
535void barrier();
536void memoryBarrier();
537void memoryBarrierAtomicCounter();
538void memoryBarrierBuffer();
539void memoryBarrierShared();
540void memoryBarrierImage();
541void groupMemoryBarrier();
542
543)