• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// The format of this file:
2//   C++ style single-line comments are supported.
3//   Leading whitespace is only for formatting and doesn't have semantic meaning.
4//
5//   Grouping:
6//   Groups of functions are denoted by "GROUP BEGIN" and "GROUP END". Groups can be nested.
7//   Groups can have metadata related to the group itself. This is given at the end of the GROUP
8//   BEGIN line in JSON object format.
9//   Example:
10//     GROUP BEGIN <group name> {"shader_type": "FRAGMENT"}
11//     GROUP END <group name>
12//
13//   Defaults:
14//   Default metadata for functions can be set with "DEFAULT METADATA" followed by metadata in JSON
15//   object format. The metadata is applied to all following functions regardless of grouping until
16//   another "DEFAULT METADATA" line is encountered, or until the end of a top-level group.
17//   Example:
18//     DEFAULT METADATA {"op": "CallBuiltInFunction"}
19//
20//   Supported function metadata properties are:
21//     "essl_level"
22//         string, one of COMMON_BUILTINS, ESSL1_BUILTINS, ESSL3_BUILTINS and ESSL3_1_BUILTINS,
23//         ESSL3_2_BUILTINS.
24//     "glsl_level"
25//         string, one of COMMON_BUILTINS, COMMON_BUILTINS, GLSL1_2_BUILTINS, GLSL1_3_BUILTINS,
26//         GLSL1_4_BUILTINS, GLSL1_5_BUILTINS, GLSL3_3_BUILTINS, GLSL4_BUILTINS, GLSL4_1_BUILTINS,
27//         GLSL4_2_BUILTINS, GLSL4_3_BUILTINS, GLSL4_4_BUILTINS, GLSL4_5_BUILTINS, and
28//         GLSL4_6_BUILTINS.
29//     "op"
30//         string, either EOp code or "auto", in which case the op is derived from the function
31//         name.
32//     "suffix"
33//         string, suffix that is used to disambiguate C++ variable names created based on the
34//         function name from C++ keywords, or disambiguate two functions with the same name.
35//     "essl_extension"
36//         string, ESSL extension where the function is defined.
37//     "glsl_extension"
38//         string, GLSL extension where the function is defined.
39//     "hasSideEffects"
40//         boolean, can be used to mark a function as having side effects even if it has op other
41//         than CallBuiltInFunction and it doesn't have out parameters. In case the op is
42//         CallBuiltInFunction or the function has out parameters it is automatically treated as
43//         having side effects.
44//
45//   Function declarations:
46//   Lines that declare functions are in a similar format as in the GLSL spec:
47//     <return type> <function name>(<param type>, ...);
48//   Parameter types can have "out" or "inout" qualifiers.
49
50GROUP BEGIN Trigonometric
51  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
52    genType radians(genType);
53    genType degrees(genType);
54    genType sin(genType);
55    genType cos(genType);
56    genType tan(genType);
57    genType asin(genType);
58    genType acos(genType);
59    genType atan(genType, genType);
60    genType atan(genType);
61  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
62    genType sinh(genType);
63    genType cosh(genType);
64    genType tanh(genType);
65    genType asinh(genType);
66    genType acosh(genType);
67    genType atanh(genType);
68GROUP END Trigonometric
69
70GROUP BEGIN Exponential
71  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
72    genType pow(genType, genType);
73    genType exp(genType);
74    genType log(genType);
75    genType exp2(genType);
76    genType log2(genType);
77    genType sqrt(genType);
78  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
79    genDType sqrt(genDType);
80  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
81    genType inversesqrt(genType);
82  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
83    genDType inversesqrt(genDType);
84GROUP END Exponential
85
86GROUP BEGIN Common
87  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
88    genType abs(genType);
89  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
90    genIType abs(genIType);
91  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
92    genDType abs(genDType);
93  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
94    genType sign(genType);
95  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
96    genIType sign(genIType);
97  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
98    genDType sign(genDType);
99  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
100    genType floor(genType);
101  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
102    genDType floor(genDType);
103  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
104    genType trunc(genType);
105  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
106    genDType trunc(genDType);
107  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
108    genType round(genType);
109  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
110    genDType round(genDType);
111  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
112    genType roundEven(genType);
113  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
114    genDType roundEven(genDType);
115  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
116    genType ceil(genType);
117  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
118    genDType ceil(genDType);
119  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
120    genType fract(genType);
121  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
122    genDType fract(genDType);
123  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
124    genType mod(genType, float);
125    genType mod(genType, genType);
126  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
127    genDType mod(genDType, double);
128    genDType mod(genDType, genDType);
129  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
130    genType min(genType, float);
131    genType min(genType, genType);
132  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
133    genDType min(genDType, genDType);
134    genDType min(genDType, double);
135  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
136    genIType min(genIType, genIType);
137    genIType min(genIType, int);
138    genUType min(genUType, genUType);
139    genUType min(genUType, uint);
140  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
141    genType max(genType, float);
142    genType max(genType, genType);
143  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
144    genDType max(genDType, genDType);
145    genDType max(genDType, double);
146  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
147    genIType max(genIType, genIType);
148    genIType max(genIType, int);
149    genUType max(genUType, genUType);
150    genUType max(genUType, uint);
151  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
152    genType clamp(genType, float, float);
153    genType clamp(genType, genType, genType);
154  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
155    genDType clamp(genDType, double, double);
156    genDType clamp(genDType, genDType, genDType);
157  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
158    genIType clamp(genIType, int, int);
159    genIType clamp(genIType, genIType, genIType);
160    genUType clamp(genUType, uint, uint);
161    genUType clamp(genUType, genUType, genUType);
162  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
163    genType mix(genType, genType, float);
164    genType mix(genType, genType, genType);
165  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
166    genDType mix(genDType, genDType, double);
167    genDType mix(genDType, genDType, genDType);
168  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
169    genType mix(genType, genType, genBType);
170  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
171    genDType mix(genDType, genDType, genBType);
172  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_5_BUILTINS", "op": "auto"}
173    genIType mix(genIType, genIType, genBType);
174    genUType mix(genUType, genUType, genBType);
175    genBType mix(genBType, genBType, genBType);
176  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
177    genType step(genType, genType);
178    genType step(float, genType);
179  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
180    genDType step(genDType, genDType);
181    genDType step(double, genDType);
182  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
183    genDType smoothstep(genDType, genDType, genDType);
184    genDType smoothstep(double, double, genDType);
185  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
186    genType smoothstep(genType, genType, genType);
187    genType smoothstep(float, float, genType);
188  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
189    genType modf(genType, out genType);
190  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
191    genDType modf(genDType, out genDType);
192  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
193    genBType isnan(genType);
194  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
195    genBType isnan(genDType);
196  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "auto"}
197    genBType isinf(genType);
198  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
199    genBType isinf(genDType);
200  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL3_3_BUILTINS", "op": "auto"}
201    genIType floatBitsToInt(genType);
202    genUType floatBitsToUint(genType);
203    genType intBitsToFloat(genIType);
204    genType uintBitsToFloat(genUType);
205  DEFAULT METADATA {"essl_level": "ESSL3_2_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto"}
206    genType fma(genType, genType, genType);
207  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "auto", "essl_extension": "EXT_gpu_shader5", "suffix": "Ext"}
208    genType fma(genType, genType, genType);
209  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
210    genType fma(genDType, genDType, genDType);
211  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto"}
212    genType frexp(genType, out genIType);
213  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
214    genDType frexp(genDType, out genIType);
215  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto"}
216    genType ldexp(genType, genIType);
217  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
218    genDType ldexp(genDType, genIType);
219  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL4_2_BUILTINS", "op": "auto"}
220    uint packSnorm2x16(vec2);
221    uint packHalf2x16(vec2);
222    vec2 unpackSnorm2x16(uint);
223    vec2 unpackHalf2x16(uint);
224  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto"}
225    uint packUnorm2x16(vec2);
226    vec2 unpackUnorm2x16(uint);
227  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto"}
228    uint packUnorm4x8(vec4);
229    uint packSnorm4x8(vec4);
230    vec4 unpackUnorm4x8(uint);
231    vec4 unpackSnorm4x8(uint);
232  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
233    double packDouble2x32(uvec2);
234    uvec2 unpackDouble2x32(double);
235GROUP END Common
236
237GROUP BEGIN Geometric
238  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
239    float length(genType);
240  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
241    double length(genDType);
242  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
243    float distance(genType, genType);
244  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
245    double distance(genDType, genDType);
246  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
247    float dot(genType, genType);
248  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
249    double dot(genDType, genDType);
250  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
251    vec3 cross(vec3, vec3);
252  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
253    dvec3 cross(dvec3, dvec3);
254  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
255    genType normalize(genType);
256  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
257    genDType normalize(genDType);
258  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
259    genType faceforward(genType, genType, genType);
260  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
261    genDType faceforward(genDType, genDType, genDType);
262  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
263    genType reflect(genType, genType);
264  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
265    genDType reflect(genDType, genDType);
266  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
267    genType refract(genType, genType, float);
268  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "auto"}
269    genDType refract(genDType, genDType, float);
270GROUP END Geometric
271
272GROUP BEGIN GeometricVS {"shader_type": "VERTEX"}
273  DEFAULT METADATA {"glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
274    vec4 ftransform();
275GROUP END GeometricVS
276
277GROUP BEGIN Matrix
278  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "MulMatrixComponentWise"}
279    mat2 matrixCompMult(mat2, mat2);
280    mat3 matrixCompMult(mat3, mat3);
281    mat4 matrixCompMult(mat4, mat4);
282  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "MulMatrixComponentWise"}
283    mat2x3 matrixCompMult(mat2x3, mat2x3);
284    mat3x2 matrixCompMult(mat3x2, mat3x2);
285    mat2x4 matrixCompMult(mat2x4, mat2x4);
286    mat4x2 matrixCompMult(mat4x2, mat4x2);
287    mat3x4 matrixCompMult(mat3x4, mat3x4);
288    mat4x3 matrixCompMult(mat4x3, mat4x3);
289  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_2_BUILTINS", "op": "auto"}
290    mat2 outerProduct(vec2, vec2);
291    mat3 outerProduct(vec3, vec3);
292    mat4 outerProduct(vec4, vec4);
293    mat2x3 outerProduct(vec3, vec2);
294    mat3x2 outerProduct(vec2, vec3);
295    mat2x4 outerProduct(vec4, vec2);
296    mat4x2 outerProduct(vec2, vec4);
297    mat3x4 outerProduct(vec4, vec3);
298    mat4x3 outerProduct(vec3, vec4);
299    mat2 transpose(mat2);
300    mat3 transpose(mat3);
301    mat4 transpose(mat4);
302    mat2x3 transpose(mat3x2);
303    mat3x2 transpose(mat2x3);
304    mat2x4 transpose(mat4x2);
305    mat4x2 transpose(mat2x4);
306    mat3x4 transpose(mat4x3);
307    mat4x3 transpose(mat3x4);
308  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "auto"}
309    float determinant(mat2);
310    float determinant(mat3);
311    float determinant(mat4);
312  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_4_BUILTINS", "op": "auto"}
313    mat2 inverse(mat2);
314    mat3 inverse(mat3);
315    mat4 inverse(mat4);
316GROUP END Matrix
317
318GROUP BEGIN Vector
319  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "LessThanComponentWise"}
320    bvec lessThan(vec, vec);
321    bvec lessThan(ivec, ivec);
322  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "LessThanComponentWise"}
323    bvec lessThan(uvec, uvec);
324  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "LessThanEqualComponentWise"}
325    bvec lessThanEqual(vec, vec);
326    bvec lessThanEqual(ivec, ivec);
327  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "LessThanEqualComponentWise"}
328    bvec lessThanEqual(uvec, uvec);
329  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "GreaterThanComponentWise"}
330    bvec greaterThan(vec, vec);
331    bvec greaterThan(ivec, ivec);
332  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "GreaterThanComponentWise"}
333    bvec greaterThan(uvec, uvec);
334  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "GreaterThanEqualComponentWise"}
335    bvec greaterThanEqual(vec, vec);
336    bvec greaterThanEqual(ivec, ivec);
337  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "GreaterThanEqualComponentWise"}
338    bvec greaterThanEqual(uvec, uvec);
339  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "EqualComponentWise"}
340    bvec equal(vec, vec);
341    bvec equal(ivec, ivec);
342  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "EqualComponentWise"}
343    bvec equal(uvec, uvec);
344  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "EqualComponentWise"}
345    bvec equal(bvec, bvec);
346  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "NotEqualComponentWise"}
347    bvec notEqual(vec, vec);
348    bvec notEqual(ivec, ivec);
349  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "NotEqualComponentWise"}
350    bvec notEqual(uvec, uvec);
351  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "NotEqualComponentWise"}
352    bvec notEqual(bvec, bvec);
353  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto"}
354    bool any(bvec);
355    bool all(bvec);
356  DEFAULT METADATA {"essl_level": "COMMON_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "LogicalNotComponentWise", "suffix": "Func"}
357    bvec not(bvec);
358GROUP END Vector
359
360GROUP BEGIN Integer
361  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto"}
362    genIType bitfieldExtract(genIType, int, int);
363    genUType bitfieldExtract(genUType, int, int);
364    genIType bitfieldInsert(genIType, genIType, int, int);
365    genUType bitfieldInsert(genUType, genUType, int, int);
366    genIType bitfieldReverse(genIType);
367    genUType bitfieldReverse(genUType);
368    genIType bitCount(genIType);
369    genIType bitCount(genUType);
370    genIType findLSB(genIType);
371    genIType findLSB(genUType);
372    genIType findMSB(genIType);
373    genIType findMSB(genUType);
374    genUType uaddCarry(genUType, genUType, out genUType);
375    genUType usubBorrow(genUType, genUType, out genUType);
376    void umulExtended(genUType, genUType, out genUType, out genUType);
377    void imulExtended(genIType, genIType, out genIType, out genIType);
378GROUP END Integer
379
380GROUP BEGIN TextureFirstVersions
381  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
382    vec4 texture2D(sampler2D, vec2);
383    vec4 texture2DProj(sampler2D, vec3);
384    vec4 texture2DProj(sampler2D, vec4);
385    vec4 textureCube(samplerCube, vec3);
386  DEFAULT METADATA {"glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
387    vec4 texture1D(sampler1D, float);
388    vec4 texture1DProj(sampler1D, vec2);
389    vec4 texture1DProj(sampler1D, vec4);
390    vec4 texture3D(sampler3D, vec3);
391    vec4 texture3DProj(sampler3D, vec4);
392    vec4 shadow1D(sampler1DShadow, vec3);
393    vec4 shadow1DProj(sampler1DShadow, vec4);
394    vec4 shadow2D(sampler2DShadow, vec3);
395    vec4 shadow2DProj(sampler2DShadow, vec4);
396GROUP END TextureFirstVersions
397
398// These are extension functions from OES_EGL_image_external and
399// NV_EGL_stream_consumer_external. We don't have a way to mark a built-in with two alternative
400// extensions, so these are marked with none. This is fine, since these functions overload core
401// function names and the functions require a samplerExternalOES parameter, which can only be
402// created if one of the extensions is enabled.
403// TODO(oetuaho): Consider implementing a cleaner solution.
404GROUP BEGIN EGL_image_external
405  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction"}
406    vec4 texture2D(samplerExternalOES, vec2);
407    vec4 texture2DProj(samplerExternalOES, vec3);
408    vec4 texture2DProj(samplerExternalOES, vec4);
409GROUP END EGL_image_external
410
411GROUP BEGIN ARB_texture_rectangle
412  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "ARB_texture_rectangle"}
413    vec4 texture2DRect(sampler2DRect, vec2);
414    vec4 texture2DRectProj(sampler2DRect, vec3);
415    vec4 texture2DRectProj(sampler2DRect, vec4);
416  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "ARB_texture_rectangle"}
417    // We don't have a rectangle texture essl_extension for OpenGL ES however based on the behavior of
418    // rectangle texture in desktop OpenGL, they should be sampled with a "texture" overload in
419    // GLSL version that have such an overload. This is the case for ESSL3 and above.
420    vec4 texture(sampler2DRect, vec2);
421    vec4 textureProj(sampler2DRect, vec3);
422    vec4 textureProj(sampler2DRect, vec4);
423GROUP END ARB_texture_rectangle
424
425// The *Grad* variants are new to both vertex and fragment shaders; the fragment
426// shader specific pieces are added separately below.
427GROUP BEGIN EXT_shader_texture_lod
428  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "EXT_shader_texture_lod"}
429    vec4 texture2DGradEXT(sampler2D, vec2, vec2, vec2);
430    vec4 texture2DProjGradEXT(sampler2D, vec3, vec2, vec2);
431    vec4 texture2DProjGradEXT(sampler2D, vec4, vec2, vec2);
432    vec4 textureCubeGradEXT(samplerCube, vec3, vec3, vec3);
433GROUP END EXT_shader_texture_lod
434
435GROUP BEGIN TextureFirstVersionsFS {"shader_type": "FRAGMENT"}
436  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
437    vec4 texture2D(sampler2D, vec2, float);
438    vec4 texture2DProj(sampler2D, vec3, float);
439    vec4 texture2DProj(sampler2D, vec4, float);
440    vec4 textureCube(samplerCube, vec3, float);
441  DEFAULT METADATA {"glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
442    vec4 texture3D(sampler3D, vec3, float);
443    vec4 texture3DProj(sampler3D, vec4, float);
444    vec4 texture3DLod(sampler3D, vec3, float);
445    vec4 texture3DProjLod(sampler3D, vec4, float);
446    vec4 texture1D(sampler1D, float, float);
447    vec4 texture1DProj(sampler1D, vec2, float);
448    vec4 texture1DProj(sampler1D, vec4, float);
449    vec4 shadow1D(sampler1DShadow, vec3, float);
450    vec4 shadow1DProj(sampler1DShadow, vec4, float);
451    vec4 shadow2D(sampler2DShadow, vec3, float);
452    vec4 shadow2DProj(sampler2DShadow, vec4, float);
453GROUP END TextureFirstVersionsFS
454
455GROUP BEGIN TextureFirstVersionsFSExt {"shader_type": "FRAGMENT"}
456  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "auto", "essl_extension": "OES_standard_derivatives", "hasSideEffects": "true", "suffix": "Ext"}
457    genType dFdx(genType);
458    genType dFdy(genType);
459    genType fwidth(genType);
460  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "EXT_shader_texture_lod"}
461    vec4 texture2DLodEXT(sampler2D, vec2, float);
462    vec4 texture2DProjLodEXT(sampler2D, vec3, float);
463    vec4 texture2DProjLodEXT(sampler2D, vec4, float);
464    vec4 textureCubeLodEXT(samplerCube, vec3, float);
465  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "OES_texture_3D"}
466    vec4 texture3D(sampler3D, vec3);
467    vec4 texture3DProj(sampler3D, vec4);
468  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "OES_texture_3D"}
469    vec4 texture3D(sampler3D, vec3, float);
470    vec4 texture3DProj(sampler3D, vec4, float);
471  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "OES_texture_3D"}
472    vec4 texture3DLod(sampler3D, vec3, float);
473    vec4 texture3DProjLod(sampler3D, vec4, float);
474GROUP END TextureFirstVersionsFSExt
475
476GROUP BEGIN TextureFirstVersionsVS {"shader_type": "VERTEX"}
477  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
478    vec4 texture2DLod(sampler2D, vec2, float);
479    vec4 texture2DProjLod(sampler2D, vec3, float);
480    vec4 texture2DProjLod(sampler2D, vec4, float);
481    vec4 textureCubeLod(samplerCube, vec3, float);
482  DEFAULT METADATA {"glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
483    vec4 texture1DLod(sampler1D, float, float);
484    vec4 texture1DProjLod(sampler1D, vec2, float);
485    vec4 texture1DProjLod(sampler1D, vec4, float);
486    vec4 shadow1DLod(sampler1DShadow, vec3, float);
487    vec4 shadow1DProjLod(sampler1DShadow, vec4, float);
488    vec4 shadow2DLod(sampler2DShadow, vec3, float);
489    vec4 shadow2DProjLod(sampler2DShadow, vec4, float);
490GROUP END TextureFirstVersionsVS
491
492GROUP BEGIN TextureNoBias
493  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
494    gvec4 texture(gsampler2D, vec2);
495    gvec4 texture(gsampler3D, vec3);
496    gvec4 texture(gsamplerCube, vec3);
497    gvec4 texture(gsampler2DArray, vec3);
498    float texture(sampler2DShadow, vec3);
499    float texture(samplerCubeShadow, vec4);
500    float texture(sampler2DArrayShadow, vec4);
501  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
502    gvec4 texture(gsampler1D, float);
503    float texture(sampler1DShadow, vec3);
504    gvec4 texture(gsampler1DArray, vec3);
505    float texture(sampler1DArrayShadow, vec3);
506  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
507    gvec4 texture(gsampler2DRect, vec2);
508    float texture(sampler2DRectShadow, vec3);
509  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
510    float texture(samplerCubeArrayShadow, vec4, float);
511  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
512    gvec4 textureProj(gsampler2D, vec3);
513    gvec4 textureProj(gsampler2D, vec4);
514    gvec4 textureProj(gsampler3D, vec4);
515    float textureProj(sampler2DShadow, vec4);
516  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
517    gvec4 textureProj(gsampler1D, vec2);
518    gvec4 textureProj(gsampler1D, vec4);
519    float textureProj(sampler1DShadow, vec4);
520  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
521    gvec4 textureProj(gsampler2DRect, vec3);
522    gvec4 textureProj(gsampler2DRect, vec4);
523    float textureProj(sampler2DRectShadow, vec4);
524  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
525    gvec4 textureLod(gsampler2D, vec2, float);
526    gvec4 textureLod(gsampler3D, vec3, float);
527    gvec4 textureLod(gsamplerCube, vec3, float);
528    gvec4 textureLod(gsampler2DArray, vec3, float);
529    float textureLod(sampler2DShadow, vec3, float);
530  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
531    gvec4 textureLod(gsampler1D, float, float);
532    float textureLod(sampler1DShadow, vec3, float);
533    gvec4 textureLod(gsampler1DArray, vec2, float);
534    float textureLod(sampler1DArrayShadow, vec3, float);
535  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
536    gvec4 textureLod(gsamplerCubeArray, vec4, float);
537  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
538    ivec2 textureSize(gsampler2D, int);
539    ivec3 textureSize(gsampler3D, int);
540    ivec2 textureSize(gsamplerCube, int);
541    ivec3 textureSize(gsampler2DArray, int);
542    ivec2 textureSize(sampler2DShadow, int);
543    ivec2 textureSize(samplerCubeShadow, int);
544    ivec3 textureSize(sampler2DArrayShadow, int);
545  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
546    int textureSize(gsampler1D, int);
547    int textureSize(sampler1DShadow, int);
548  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
549    ivec3 textureSize(gsamplerCubeArray, int);
550    ivec3 textureSize(samplerCubeArrayShadow, int);
551  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
552    ivec2 textureSize(gsampler2DRect);
553    ivec2 textureSize(sampler2DRectShadow);
554  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
555    ivec2 textureSize(gsampler1DArray, int);
556    ivec2 textureSize(sampler1DArrayShadow, int);
557  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
558    int textureSize(gsamplerBuffer);
559  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
560    gvec4 textureProjLod(gsampler2D, vec3, float);
561    gvec4 textureProjLod(gsampler2D, vec4, float);
562    gvec4 textureProjLod(gsampler3D, vec4, float);
563    float textureProjLod(sampler2DShadow, vec4, float);
564  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
565    gvec4 textureProjLod(gsampler1D, vec2, float);
566    gvec4 textureProjLod(gsampler1D, vec4, float);
567    float textureProjLod(sampler1DShadow, vec4, float);
568  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
569    gvec4 texelFetch(gsampler2D, ivec2, int);
570    gvec4 texelFetch(gsampler3D, ivec3, int);
571    gvec4 texelFetch(gsampler2DArray, ivec3, int);
572  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
573    gvec4 texelFetch(gsampler1D, int, int);
574  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
575    gvec4 texelFetch(gsampler2DRect, ivec2);
576  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
577    gvec4 texelFetch(gsampler1DArray, ivec2, int);
578  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
579    gvec4 texelFetch(gsamplerBuffer, int);
580  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
581    gvec4 textureGrad(gsampler2D, vec2, vec2, vec2);
582    gvec4 textureGrad(gsampler3D, vec3, vec3, vec3);
583    gvec4 textureGrad(gsamplerCube, vec3, vec3, vec3);
584  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
585    gvec4 textureGrad(gsampler2D, float, float, float);
586  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
587    gvec4 textureGrad(gsampler2DRect, vec2, vec2, vec2);
588    gvec4 textureGrad(sampler2DRectShadow, vec3, vec2, vec2);
589  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
590    float textureGrad(sampler2DShadow, vec3, vec2, vec2);
591    float textureGrad(samplerCubeShadow, vec4, vec3, vec3);
592    gvec4 textureGrad(gsampler2DArray, vec3, vec2, vec2);
593    float textureGrad(sampler2DArrayShadow, vec4, vec2, vec2);
594  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
595    float textureGrad(sampler1DShadow, vec3, float, float);
596    gvec4 textureGrad(gsampler1DArray, vec2, float, float);
597    float textureGrad(sampler1DArrayShadow, vec3, float, float);
598  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
599    gvec4 textureGrad(gsamplerCubeArray, vec4, vec3, vec3);
600  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
601    gvec4 textureProjGrad(gsampler2D, vec3, vec2, vec2);
602    gvec4 textureProjGrad(gsampler2D, vec4, vec2, vec2);
603    gvec4 textureProjGrad(gsampler3D, vec4, vec3, vec3);
604    float textureProjGrad(sampler2DShadow, vec4, vec2, vec2);
605  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
606    gvec4 textureProjGrad(gsampler1D, vec2, float, float);
607    gvec4 textureProjGrad(gsampler1D, vec4, float, float);
608    float textureProjGrad(sampler1DShadow, vec4, float, float);
609  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
610    gvec4 textureProjGrad(gsampler2DRect, vec3, vec2, vec2);
611    gvec4 textureProjGrad(gsampler2DRect, vec4, vec2, vec2);
612    float textureProjGrad(sampler2DRectShadow, vec4, vec2, vec2);
613  DEFAULT METADATA {"glsl_level": "GLSL4_3_BUILTINS", "op": "CallBuiltInFunction"}
614    int textureQueryLevels(gsampler1D);
615    int textureQueryLevels(gsampler2D);
616    int textureQueryLevels(gsampler3D);
617    int textureQueryLevels(gsamplerCube);
618    int textureQueryLevels(gsampler1DArray);
619    int textureQueryLevels(gsampler2DArray);
620    int textureQueryLevels(gsamplerCubeArray);
621    int textureQueryLevels(sampler1DShadow);
622    int textureQueryLevels(sampler2DShadow);
623    int textureQueryLevels(samplerCubeShadow);
624    int textureQueryLevels(sampler1DArrayShadow);
625    int textureQueryLevels(sampler2DArrayShadow);
626    int textureQueryLevels(samplerCubeArrayShadow);
627  DEFAULT METADATA {"glsl_level": "GLSL4_5_BUILTINS", "op": "CallBuiltInFunction"}
628    int textureSamples(gsampler2DMS);
629    int textureSamples(gsampler2DMSArray);
630GROUP END TextureNoBias
631
632GROUP BEGIN TextureSizeMS
633  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction"}
634    ivec2 textureSize(gsampler2DMS);
635GROUP END TextureSizeMS
636
637GROUP BEGIN TextureSizeMSExt
638  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "ANGLE_texture_multisample", "suffix": "Ext"}
639    ivec2 textureSize(gsampler2DMS);
640GROUP END TextureSizeMSExt
641
642GROUP BEGIN TextureSizeMSArray
643  DEFAULT METADATA {"glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction"}
644    ivec3 textureSize(gsampler2DMSArray);
645GROUP END TextureSizeMSArray
646
647GROUP BEGIN TextureSizeMSArrayExt
648  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "OES_texture_storage_multisample_2d_array", "suffix": "Ext"}
649    ivec3 textureSize(gsampler2DMSArray);
650GROUP END TextureSizeMSArrayExt
651
652GROUP BEGIN TexelFetchMS
653  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction"}
654    gvec4 texelFetch(gsampler2DMS, ivec2, int);
655GROUP END TexelFetchMS
656
657GROUP BEGIN TexelFetchMSExt
658  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "ANGLE_texture_multisample", "suffix": "Ext"}
659    gvec4 texelFetch(gsampler2DMS, ivec2, int);
660GROUP END TexelFetchMSExt
661
662GROUP BEGIN TexelFetchMSArray
663  DEFAULT METADATA {"glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction"}
664    gvec4 texelFetch(gsampler2DMSArray, ivec3, int);
665GROUP END TexelFetchMSArray
666
667GROUP BEGIN TexelFetchMSArrayExt
668  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "OES_texture_storage_multisample_2d_array", "suffix": "Ext"}
669    gvec4 texelFetch(gsampler2DMSArray, ivec3, int);
670GROUP END TexelFetchMSArrayExt
671
672GROUP BEGIN TextureBias {"shader_type": "FRAGMENT"}
673  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
674    gvec4 texture(gsampler2D, vec2, float);
675    gvec4 texture(gsampler3D, vec3, float);
676    gvec4 texture(gsamplerCube, vec3, float);
677    gvec4 texture(gsampler2DArray, vec3, float);
678    gvec4 textureProj(gsampler2D, vec3, float);
679    gvec4 textureProj(gsampler2D, vec4, float);
680    gvec4 textureProj(gsampler3D, vec4, float);
681    float texture(sampler2DShadow, vec3, float);
682    float texture(samplerCubeShadow, vec4, float);
683    float textureProj(sampler2DShadow, vec4, float);
684  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
685    gvec4 texture(gsampler1D, float, float);
686    float texture(sampler1DShadow, vec3, float);
687    gvec4 texture(gsampler1DArray, vec3, float);
688    float texture(sampler1DArrayShadow, vec3, float);
689    float texture(sampler2DArrayShadow, vec4, float);
690    gvec4 textureProj(gsampler1D, vec2, float);
691    gvec4 textureProj(gsampler1D, vec4, float);
692    float textureProj(sampler1DShadow, vec4, float);
693  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "OES_EGL_image_external_essl3"}
694    vec4 texture(samplerExternalOES, vec2, float);
695    vec4 textureProj(samplerExternalOES, vec3, float);
696    vec4 textureProj(samplerExternalOES, vec4, float);
697  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "EXT_YUV_target"}
698    vec4 texture(samplerExternal2DY2YEXT, vec2, float);
699    vec4 textureProj(samplerExternal2DY2YEXT, vec3, float);
700    vec4 textureProj(samplerExternal2DY2YEXT, vec4, float);
701GROUP END TextureBias
702
703GROUP BEGIN TextureQueryLod {"shader_type": "FRAGMENT"}
704  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
705    vec2 textureQueryLod(gsampler1D, float);
706    vec2 textureQueryLod(gsampler2D, vec2);
707    vec2 textureQueryLod(gsampler3D, vec3);
708    vec2 textureQueryLod(gsamplerCube, vec3);
709    vec2 textureQueryLod(gsampler1DArray, float);
710    vec2 textureQueryLod(gsampler2DArray, vec2);
711    vec2 textureQueryLod(gsamplerCubeArray, vec3);
712    vec2 textureQueryLod(sampler1DShadow, float);
713    vec2 textureQueryLod(sampler2DShadow, vec2);
714    vec2 textureQueryLod(samplerCubeShadow, vec3);
715    vec2 textureQueryLod(sampler1DArrayShadow, float);
716    vec2 textureQueryLod(sampler2DArrayShadow, vec2);
717    vec2 textureQueryLod(samplerCubeArrayShadow, vec3);
718GROUP END TextureQueryLod
719
720GROUP BEGIN TextureOffsetNoBias {"queryFunction": true}
721  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
722    gvec4 textureOffset(gsampler2D, vec2, ivec2);
723    gvec4 textureOffset(gsampler3D, vec3, ivec3);
724    float textureOffset(sampler2DShadow, vec3, ivec2);
725    gvec4 textureOffset(gsampler2DArray, vec3, ivec2);
726  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
727    gvec4 textureOffset(gsampler1D, float, int);
728  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
729    gvec4 textureOffset(gsampler2DRect, vec2, ivec2);
730    float textureOffset(sampler2DRectShadow, vec3, ivec2);
731  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
732    float textureOffset(sampler1DShadow, vec3, int);
733    gvec4 textureOffset(gsampler1DArray, vec2, int);
734    float textureOffset(sampler1DArrayShadow, vec3, int);
735  DEFAULT METADATA {"glsl_level": "GLSL4_3_BUILTINS", "op": "CallBuiltInFunction"}
736    float textureOffset(sampler2DArrayShadow, vec4, ivec2);
737  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
738    gvec4 textureProjOffset(gsampler2D, vec3, ivec2);
739    gvec4 textureProjOffset(gsampler2D, vec4, ivec2);
740    gvec4 textureProjOffset(gsampler3D, vec4, ivec3);
741    float textureProjOffset(sampler2DShadow, vec4, ivec2);
742  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
743    gvec4 textureProjOffset(gsampler1D, vec2, int);
744    gvec4 textureProjOffset(gsampler1D, vec4, int);
745  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
746    gvec4 textureProjOffset(gsampler2DRect, vec3, ivec2);
747    gvec4 textureProjOffset(gsampler2DRect, vec4, ivec2);
748    float textureProjOffset(sampler2DRectShadow, vec4, ivec2);
749  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
750    float textureProjOffset(sampler1DShadow, vec4, int);
751  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
752    gvec4 textureLodOffset(gsampler2D, vec2, float, ivec2);
753    gvec4 textureLodOffset(gsampler3D, vec3, float, ivec3);
754    float textureLodOffset(sampler2DShadow, vec3, float, ivec2);
755    gvec4 textureLodOffset(gsampler2DArray, vec3, float, ivec2);
756  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
757    gvec4 textureLodOffset(gsampler1D, float, float, int);
758    float textureLodOffset(sampler1DShadow, vec3, float, int);
759    gvec4 textureLodOffset(gsampler1DArray, vec2, float, int);
760    float textureLodOffset(sampler1DArrayShadow, vec3, float, int);
761  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
762    gvec4 textureProjLodOffset(gsampler2D, vec3, float, ivec2);
763    gvec4 textureProjLodOffset(gsampler2D, vec4, float, ivec2);
764    gvec4 textureProjLodOffset(gsampler3D, vec4, float, ivec3);
765    float textureProjLodOffset(sampler2DShadow, vec4, float, ivec2);
766  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
767    gvec4 textureProjLodOffset(gsampler1D, vec2, float, int);
768    gvec4 textureProjLodOffset(gsampler1D, vec4, float, int);
769    float textureProjLodOffset(sampler1DShadow, vec4, float, int);
770  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
771    gvec4 texelFetchOffset(gsampler2D, ivec2, int, ivec2);
772    gvec4 texelFetchOffset(gsampler3D, ivec3, int, ivec3);
773    gvec4 texelFetchOffset(gsampler2DArray, ivec3, int, ivec2);
774  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
775    gvec4 texelFetchOffset(gsampler1D, int, int, int);
776  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
777    gvec4 texelFetchOffset(gsampler2DRect, ivec2, ivec2);
778  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
779    gvec4 texelFetchOffset(gsampler1DArray, ivec2, int, int);
780  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
781    gvec4 textureGradOffset(gsampler2D, vec2, vec2, vec2, ivec2);
782    gvec4 textureGradOffset(gsampler3D, vec3, vec3, vec3, ivec3);
783    float textureGradOffset(sampler2DShadow, vec3, vec2, vec2, ivec2);
784    gvec4 textureGradOffset(gsampler2DArray, vec3, vec2, vec2, ivec2);
785    float textureGradOffset(sampler2DArrayShadow, vec4, vec2, vec2, ivec2);
786  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
787    gvec4 textureGradOffset(gsampler1D, float, float, float, int);
788  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
789    gvec4 textureGradOffset(gsampler2DRect, vec2, vec2, vec2, ivec2);
790    float textureGradOffset(sampler2DRectShadow, vec3, vec2, vec2, ivec2);
791  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
792    float textureGradOffset(sampler1DShadow, vec3, float, float, int);
793    gvec4 textureGradOffset(gsampler1DArray, vec2, float, float, int);
794    float textureGradOffset(sampler1DArrayShadow, vec3, float, float, int);
795  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
796    gvec4 textureProjGradOffset(gsampler2D, vec3, vec2, vec2, ivec2);
797    gvec4 textureProjGradOffset(gsampler2D, vec4, vec2, vec2, ivec2);
798    gvec4 textureProjGradOffset(gsampler3D, vec4, vec3, vec3, ivec3);
799    float textureProjGradOffset(sampler2DShadow, vec4, vec2, vec2, ivec2);
800  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
801    gvec4 textureProjGradOffset(gsampler1D, vec2, float, float, int);
802    gvec4 textureProjGradOffset(gsampler1D, vec4, float, float, int);
803  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
804    gvec4 textureProjGradOffset(gsampler2DRect, vec3, vec2, vec2, ivec2);
805    gvec4 textureProjGradOffset(gsampler2DRect, vec4, vec2, vec2, ivec2);
806    float textureProjGradOffset(sampler2DRectShadow, vec4, vec2, vec2, ivec2);
807  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
808    float textureProjGradOffset(sampler1DShadow, vec4, float, float, int);
809GROUP END TextureOffsetNoBias
810
811GROUP BEGIN TextureOffsetBias {"queryFunction": true, "shader_type": "FRAGMENT"}
812  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
813    gvec4 textureOffset(gsampler2D, vec2, ivec2, float);
814    gvec4 textureOffset(gsampler3D, vec3, ivec3, float);
815    float textureOffset(sampler2DShadow, vec3, ivec2, float);
816    gvec4 textureOffset(gsampler2DArray, vec3, ivec2, float);
817  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
818    gvec4 textureOffset(gsampler1D, float, int, float);
819    float textureOffset(sampler1DShadow, vec3, int, float);
820    gvec4 textureOffset(gsampler1DArray, vec2, int, float);
821    float textureOffset(sampler1DArrayShadow, vec3, int, float);
822  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
823    gvec4 textureProjOffset(gsampler2D, vec3, ivec2, float);
824    gvec4 textureProjOffset(gsampler2D, vec4, ivec2, float);
825    gvec4 textureProjOffset(gsampler3D, vec4, ivec3, float);
826    float textureProjOffset(sampler2DShadow, vec4, ivec2, float);
827  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
828    gvec4 textureProjOffset(gsampler1D, vec2, int, float);
829    gvec4 textureProjOffset(gsampler1D, vec4, int, float);
830    float textureProjOffset(sampler1DShadow, vec4, int, float);
831GROUP END TextureOffsetBias
832
833GROUP BEGIN EGL_image_external_essl3
834  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "OES_EGL_image_external_essl3"}
835    vec4 texture(samplerExternalOES, vec2);
836    vec4 textureProj(samplerExternalOES, vec3);
837    vec4 textureProj(samplerExternalOES, vec4);
838    ivec2 textureSize(samplerExternalOES, int);
839    vec4 texelFetch(samplerExternalOES, ivec2, int);
840GROUP END EGL_image_external_essl3
841
842GROUP BEGIN EXT_yuv_target
843  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "EXT_YUV_target"}
844    vec4 texture(samplerExternal2DY2YEXT, vec2);
845    vec4 textureProj(samplerExternal2DY2YEXT, vec3);
846    vec4 textureProj(samplerExternal2DY2YEXT, vec4);
847    vec3 rgb_2_yuv(vec3, yuvCscStandardEXT);
848    vec3 yuv_2_rgb(vec3, yuvCscStandardEXT);
849    ivec2 textureSize(samplerExternal2DY2YEXT, int);
850    vec4 texelFetch(samplerExternal2DY2YEXT, ivec2, int);
851GROUP END EXT_yuv_target
852
853GROUP BEGIN TextureGather {"queryFunction": true}
854  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
855    gvec4 textureGather(gsampler2D, vec2);
856    gvec4 textureGather(gsampler2D, vec2, int);
857    gvec4 textureGather(gsampler2DArray, vec3);
858    gvec4 textureGather(gsampler2DArray, vec3, int);
859    gvec4 textureGather(gsamplerCube, vec3);
860    gvec4 textureGather(gsamplerCube, vec3, int);
861  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
862    gvec4 textureGather(gsamplerCubeArray, vec4);
863    gvec4 textureGather(gsamplerCubeArray, vec4, int);
864    gvec4 textureGather(gsampler2DRect, vec3);
865    gvec4 textureGather(gsampler2DRect, vec3, int);
866  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
867    vec4 textureGather(sampler2DShadow, vec2);
868  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
869    vec4 textureGather(sampler2DShadow, vec2, float);
870  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
871    vec4 textureGather(sampler2DArrayShadow, vec3);
872  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
873    vec4 textureGather(sampler2DArrayShadow, vec3, float);
874  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
875    vec4 textureGather(samplerCubeShadow, vec3);
876  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
877    vec4 textureGather(samplerCubeShadow, vec3, float);
878  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
879    vec4 textureGather(samplerCubeArrayShadow, vec4, float);
880    vec4 textureGather(sampler2DRectShadow, vec2, float);
881
882    GROUP BEGIN Offset {"queryFunction": true}
883      GROUP BEGIN NoComp {"queryFunction": true}
884        DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
885          gvec4 textureGatherOffset(gsampler2D, vec2, ivec2);
886          gvec4 textureGatherOffset(gsampler2DArray, vec3, ivec2);
887          vec4 textureGatherOffset(sampler2DShadow, vec2, float, ivec2);
888          vec4 textureGatherOffset(sampler2DArrayShadow, vec3, float, ivec2);
889        DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
890          gvec4 textureGatherOffset(gsampler2DRect, vec2, ivec2);
891          vec4 textureGatherOffset(sampler2DRectShadow, vec2, float, ivec2);
892      GROUP END NoComp
893      GROUP BEGIN Comp {"queryFunction": true}
894        DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
895          gvec4 textureGatherOffset(gsampler2D, vec2, ivec2, int);
896          gvec4 textureGatherOffset(gsampler2DArray, vec3, ivec2, int);
897        DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
898          gvec4 textureGatherOffset(gsampler2DRect, vec2, ivec2, int);
899      GROUP END Comp
900    GROUP END Offset
901    GROUP BEGIN Offsets {"queryFunction": true}
902      GROUP BEGIN NoComp {"queryFunction": true}
903        DEFAULT METADATA {"essl_level": "ESSL3_2_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
904          gvec4 textureGatherOffsets(gsampler2D, vec2, ivec2[4]);
905          gvec4 textureGatherOffsets(gsampler2DArray, vec3, ivec2[4]);
906          vec4 textureGatherOffsets(sampler2DShadow, vec2, float, ivec2[4]);
907          vec4 textureGatherOffsets(sampler2DArrayShadow, vec3, float, ivec2[4]);
908        DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "EXT_gpu_shader5", "suffix": "Ext"}
909          gvec4 textureGatherOffsets(gsampler2D, vec2, ivec2[4]);
910          gvec4 textureGatherOffsets(gsampler2DArray, vec3, ivec2[4]);
911          vec4 textureGatherOffsets(sampler2DShadow, vec2, float, ivec2[4]);
912          vec4 textureGatherOffsets(sampler2DArrayShadow, vec3, float, ivec2[4]);
913        DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
914          gvec4 textureGatherOffsets(gsampler2DRect, vec2, ivec2[4]);
915          vec4 textureGatherOffsets(sampler2DRectShadow, vec2, float, ivec2[4]);
916      GROUP END NoComp
917      GROUP BEGIN Comp {"queryFunction": true}
918        DEFAULT METADATA {"essl_level": "ESSL3_2_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
919          gvec4 textureGatherOffsets(gsampler2D, vec2, ivec2[4], int);
920          gvec4 textureGatherOffsets(gsampler2DArray, vec3, ivec2[4], int);
921        DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "EXT_gpu_shader5", "suffix": "Ext"}
922          gvec4 textureGatherOffsets(gsampler2D, vec2, ivec2[4], int);
923          gvec4 textureGatherOffsets(gsampler2DArray, vec3, ivec2[4], int);
924        DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
925          gvec4 textureGatherOffsets(gsampler2DRect, vec2, ivec2[4], int);
926      GROUP END Comp
927    GROUP END Offsets
928GROUP END TextureGather
929
930GROUP BEGIN DerivativesFS {"shader_type": "FRAGMENT"}
931  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto", "hasSideEffects": "true"}
932    genType dFdx(genType);
933    genType dFdy(genType);
934    genType fwidth(genType);
935  DEFAULT METADATA {"glsl_level": "GLSL4_5_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": "true"}
936    genType dFdxFine(genType);
937    genType dFdyFine(genType);
938    genType dFdxCoarse(genType);
939    genType dFdyCoarse(genType);
940    genType fwidthFine(genType);
941    genType fwidthCoarse(genType);
942GROUP END DerivativesFS
943
944GROUP BEGIN InterpolationFS {"shader_type": "FRAGMENT"}
945  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
946    float interpolateAtCentroid(float);
947    vec2 interpolateAtCentroid(vec2);
948    vec3 interpolateAtCentroid(vec3);
949    vec4 interpolateAtCentroid(vec4);
950    float interpolateAtSample(float, int);
951    vec2 interpolateAtSample(vec2, int);
952    vec3 interpolateAtSample(vec3, int);
953    vec4 interpolateAtSample(vec4, int);
954    float interpolateAtOffset(float, vec2);
955    vec2 interpolateAtOffset(vec2, vec2);
956    vec3 interpolateAtOffset(vec3, vec2);
957    vec4 interpolateAtOffset(vec4, vec2);
958GROUP END InterpolationFS
959
960GROUP BEGIN AtomicCounter
961  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
962    uint atomicCounter(atomic_uint);
963    uint atomicCounterIncrement(atomic_uint);
964    uint atomicCounterDecrement(atomic_uint);
965  DEFAULT METADATA {"glsl_level": "GLSL4_6_BUILTINS", "op": "CallBuiltInFunction"}
966    uint atomicCounterAdd(atomic_uint, uint);
967    uint atomicCounterSubtract(atomic_uint, uint);
968    uint atomicCounterMin(atomic_uint, uint);
969    uint atomicCounterMax(atomic_uint, uint);
970    uint atomicCounterAnd(atomic_uint, uint);
971    uint atomicCounterOr(atomic_uint, uint);
972    uint atomicCounterXor(atomic_uint, uint);
973    uint atomicCounterExchange(atomic_uint, uint);
974    uint atomicCounterCompSwap(atomic_uint, uint, uint);
975GROUP END AtomicCounter
976
977GROUP BEGIN AtomicMemory {"queryFunction": true}
978  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_3_BUILTINS", "op": "auto"}
979    uint atomicAdd(inout uint, uint);
980    int atomicAdd(inout int, int);
981    uint atomicMin(inout uint, uint);
982    int atomicMin(inout int, int);
983    uint atomicMax(inout uint, uint);
984    int atomicMax(inout int, int);
985    uint atomicAnd(inout uint, uint);
986    int atomicAnd(inout int, int);
987    uint atomicOr(inout uint, uint);
988    int atomicOr(inout int, int);
989    uint atomicXor(inout uint, uint);
990    int atomicXor(inout int, int);
991    uint atomicExchange(inout uint, uint);
992    int atomicExchange(inout int, int);
993    uint atomicCompSwap(inout uint, uint, uint);
994    int atomicCompSwap(inout int, int, int);
995GROUP END AtomicMemory
996
997GROUP BEGIN Image {"queryFunction": true}
998    GROUP BEGIN Store {"queryFunction": true}
999      DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
1000        void imageStore(gimage2D, ivec2, gvec4);
1001        void imageStore(gimage3D, ivec3, gvec4);
1002        void imageStore(gimage2DArray, ivec3, gvec4);
1003        void imageStore(gimageCube, ivec3, gvec4);
1004      DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
1005        void imageStore(writeonly IMAGE_PARAMS, gvec4);
1006    GROUP END Store
1007    GROUP BEGIN Load {"queryFunction": true}
1008      DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
1009        gvec4 imageLoad(gimage2D, ivec2);
1010        gvec4 imageLoad(gimage3D, ivec3);
1011        gvec4 imageLoad(gimage2DArray, ivec3);
1012        gvec4 imageLoad(gimageCube, ivec3);
1013      DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
1014        gvec4 imageLoad(readonly IMAGE_PARAMS);
1015    GROUP END Load
1016  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
1017    ivec2 imageSize(gimage2D);
1018    ivec3 imageSize(gimage3D);
1019    ivec3 imageSize(gimage2DArray);
1020    ivec2 imageSize(gimageCube);
1021  DEFAULT METADATA {"glsl_level": "GLSL4_3_BUILTINS", "op": "CallBuiltInFunction"}
1022    int imageSize(readonly writeonly gimage1D);
1023    ivec2 imageSize(readonly writeonly gimage2D);
1024    ivec3 imageSize(readonly writeonly gimage3D);
1025    ivec2 imageSize(readonly writeonly gimageCube);
1026    ivec3 imageSize(readonly writeonly gimageCubeArray);
1027    ivec2 imageSize(readonly writeonly gimageRect);
1028    ivec2 imageSize(readonly writeonly gimage1DArray);
1029    ivec3 imageSize(readonly writeonly gimage2DArray);
1030    int imageSize(readonly writeonly gimageBuffer);
1031    ivec2 imageSize(readonly writeonly gimage2DMS);
1032    ivec3 imageSize(readonly writeonly gimage2DMSArray);
1033  DEFAULT METADATA {"glsl_level": "GLSL4_5_BUILTINS", "op": "CallBuiltInFunction"}
1034    int imageSamples(readonly writeonly gimage2DMS);
1035    int imageSamples(readonly writeonly gimage2DMSArray);
1036  DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
1037    uint imageAtomicAdd(IMAGE_PARAMS, uint);
1038    int imageAtomicAdd(IMAGE_PARAMS, int);
1039    uint imageAtomicMin(IMAGE_PARAMS, uint);
1040    int imageAtomicMin(IMAGE_PARAMS, int);
1041    uint imageAtomicMax(IMAGE_PARAMS, uint);
1042    int imageAtomicMax(IMAGE_PARAMS, int);
1043    uint imageAtomicAnd(IMAGE_PARAMS, uint);
1044    int imageAtomicAnd(IMAGE_PARAMS, int);
1045    uint imageAtomicOr(IMAGE_PARAMS, uint);
1046    int imageAtomicOr(IMAGE_PARAMS, int);
1047    uint imageAtomicXor(IMAGE_PARAMS, uint);
1048    int imageAtomicXor(IMAGE_PARAMS, int);
1049    uint imageAtomicExchange(IMAGE_PARAMS, uint);
1050    int imageAtomicExchange(IMAGE_PARAMS, int);
1051  DEFAULT METADATA {"glsl_level": "GLSL4_5_BUILTINS", "op": "CallBuiltInFunction"}
1052    int imageAtomicExchange(IMAGE_PARAMS, float);
1053  DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
1054    uint imageAtomicCompSwap(IMAGE_PARAMS, uint, uint);
1055    int imageAtomicCompSwap(IMAGE_PARAMS, int, int);
1056GROUP END Image
1057
1058GROUP BEGIN Noise
1059  DEFAULT METADATA {"glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
1060    float noise1(genType);
1061    vec2 noise2(genType);
1062    vec3 noise3(genType);
1063    vec4 noise4(genType);
1064GROUP END Noise
1065
1066GROUP BEGIN Barrier
1067  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_2_BUILTINS", "op": "auto", "hasSideEffects": true}
1068    void memoryBarrier();
1069  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_3_BUILTINS", "op": "auto", "hasSideEffects": true}
1070    void memoryBarrierAtomicCounter();
1071    void memoryBarrierBuffer();
1072    void memoryBarrierImage();
1073GROUP END Barrier
1074
1075GROUP BEGIN ESSL310CS {"shader_type": "COMPUTE"}
1076  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto", "hasSideEffects": true}
1077    void barrier();
1078  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_3_BUILTINS", "op": "auto", "hasSideEffects": true}
1079    void memoryBarrierShared();
1080    void groupMemoryBarrier();
1081GROUP END ESSL310CS
1082
1083GROUP BEGIN ESSL310GS {"shader_type": "GEOMETRY_EXT"}
1084  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "auto", "essl_extension": "EXT_geometry_shader", "hasSideEffects": true}
1085    void EmitVertex();
1086    void EndPrimitive();
1087GROUP END ESSL310GS
1088
1089GROUP BEGIN GLSLGS {"shader_type": "GEOMETRY"}
1090  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": "true"}
1091    void EmitStreamVertex(int);
1092    void EndStreamPrimitive(int);
1093  DEFAULT METADATA {"glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": "true"}
1094    void EmitVertex();
1095    void EndPrimitive();
1096GROUP END GLSLGS
1097
1098GROUP BEGIN SubpassInput
1099  DEFAULT METADATA {"glsl_level": "GLSL4_6_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": true}
1100    gvec4 subpassLoad(gsubpassInput);
1101    gvec4 subpassLoad(gsubpassInputMS, int);
1102GROUP END SubpassInput
1103
1104GROUP BEGIN ShaderInvocationGroup
1105  DEFAULT METADATA {"glsl_level": "GLSL4_6_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": true}
1106    bool anyInvocation(bool);
1107    bool allInvocations(bool);
1108    bool allInvocationsEqual(bool);
1109GROUP END ShaderInvocationGroup
1110
1111GROUP BEGIN WEBGLVideoTexture
1112  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction", "extension": "WEBGL_video_texture"}
1113      vec4 textureVideoWEBGL(samplerVideoWEBGL, vec2);
1114  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction", "extension": "WEBGL_video_texture"}
1115    vec4 texture(samplerVideoWEBGL, vec2);
1116GROUP END WEBGLVideoTexture
1117