• 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
652// These functions are part of OES/EXT_texture_cube_map.
653// There's no way to mark alternative extensions for builtins, so these are marked with none.
654// TODO(anglebug.com/4589)
655GROUP BEGIN OES_cube_map_array
656  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
657    ivec3 textureSize(gsamplerCubeArray, int);
658    ivec3 textureSize(samplerCubeArrayShadow, int);
659    gvec4 texture(gsamplerCubeArray, vec4);
660    gvec4 texture(gsamplerCubeArray, vec4, float);
661    float texture(samplerCubeArrayShadow, vec4, float);
662    gvec4 textureLod(gsamplerCubeArray, vec4, float);
663    gvec4 textureGrad(gsamplerCubeArray, vec4, vec3, vec3);
664    gvec4 textureGather(gsamplerCubeArray, vec4);
665    gvec4 textureGather(gsamplerCubeArray, vec4, int);
666    vec4 textureGather(samplerCubeArrayShadow, vec4, float);
667GROUP END OES_cube_map_array
668
669GROUP BEGIN TexelFetchMS
670  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction"}
671    gvec4 texelFetch(gsampler2DMS, ivec2, int);
672GROUP END TexelFetchMS
673
674GROUP BEGIN TexelFetchMSExt
675  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "ANGLE_texture_multisample", "suffix": "Ext"}
676    gvec4 texelFetch(gsampler2DMS, ivec2, int);
677GROUP END TexelFetchMSExt
678
679GROUP BEGIN TexelFetchMSArray
680  DEFAULT METADATA {"glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction"}
681    gvec4 texelFetch(gsampler2DMSArray, ivec3, int);
682GROUP END TexelFetchMSArray
683
684GROUP BEGIN TexelFetchMSArrayExt
685  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "OES_texture_storage_multisample_2d_array", "suffix": "Ext"}
686    gvec4 texelFetch(gsampler2DMSArray, ivec3, int);
687GROUP END TexelFetchMSArrayExt
688
689GROUP BEGIN TextureBias {"shader_type": "FRAGMENT"}
690  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
691    gvec4 texture(gsampler2D, vec2, float);
692    gvec4 texture(gsampler3D, vec3, float);
693    gvec4 texture(gsamplerCube, vec3, float);
694    gvec4 texture(gsampler2DArray, vec3, float);
695    gvec4 textureProj(gsampler2D, vec3, float);
696    gvec4 textureProj(gsampler2D, vec4, float);
697    gvec4 textureProj(gsampler3D, vec4, float);
698    float texture(sampler2DShadow, vec3, float);
699    float texture(samplerCubeShadow, vec4, float);
700    float textureProj(sampler2DShadow, vec4, float);
701  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
702    gvec4 texture(gsampler1D, float, float);
703    float texture(sampler1DShadow, vec3, float);
704    gvec4 texture(gsampler1DArray, vec3, float);
705    float texture(sampler1DArrayShadow, vec3, float);
706    float texture(sampler2DArrayShadow, vec4, float);
707    gvec4 textureProj(gsampler1D, vec2, float);
708    gvec4 textureProj(gsampler1D, vec4, float);
709    float textureProj(sampler1DShadow, vec4, float);
710  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "OES_EGL_image_external_essl3"}
711    vec4 texture(samplerExternalOES, vec2, float);
712    vec4 textureProj(samplerExternalOES, vec3, float);
713    vec4 textureProj(samplerExternalOES, vec4, float);
714  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "EXT_YUV_target"}
715    vec4 texture(samplerExternal2DY2YEXT, vec2, float);
716    vec4 textureProj(samplerExternal2DY2YEXT, vec3, float);
717    vec4 textureProj(samplerExternal2DY2YEXT, vec4, float);
718GROUP END TextureBias
719
720GROUP BEGIN TextureQueryLod {"shader_type": "FRAGMENT"}
721  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
722    vec2 textureQueryLod(gsampler1D, float);
723    vec2 textureQueryLod(gsampler2D, vec2);
724    vec2 textureQueryLod(gsampler3D, vec3);
725    vec2 textureQueryLod(gsamplerCube, vec3);
726    vec2 textureQueryLod(gsampler1DArray, float);
727    vec2 textureQueryLod(gsampler2DArray, vec2);
728    vec2 textureQueryLod(gsamplerCubeArray, vec3);
729    vec2 textureQueryLod(sampler1DShadow, float);
730    vec2 textureQueryLod(sampler2DShadow, vec2);
731    vec2 textureQueryLod(samplerCubeShadow, vec3);
732    vec2 textureQueryLod(sampler1DArrayShadow, float);
733    vec2 textureQueryLod(sampler2DArrayShadow, vec2);
734    vec2 textureQueryLod(samplerCubeArrayShadow, vec3);
735GROUP END TextureQueryLod
736
737GROUP BEGIN TextureOffsetNoBias {"queryFunction": true}
738  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
739    gvec4 textureOffset(gsampler2D, vec2, ivec2);
740    gvec4 textureOffset(gsampler3D, vec3, ivec3);
741    float textureOffset(sampler2DShadow, vec3, ivec2);
742    gvec4 textureOffset(gsampler2DArray, vec3, ivec2);
743  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
744    gvec4 textureOffset(gsampler1D, float, int);
745  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
746    gvec4 textureOffset(gsampler2DRect, vec2, ivec2);
747    float textureOffset(sampler2DRectShadow, vec3, ivec2);
748  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
749    float textureOffset(sampler1DShadow, vec3, int);
750    gvec4 textureOffset(gsampler1DArray, vec2, int);
751    float textureOffset(sampler1DArrayShadow, vec3, int);
752  DEFAULT METADATA {"glsl_level": "GLSL4_3_BUILTINS", "op": "CallBuiltInFunction"}
753    float textureOffset(sampler2DArrayShadow, vec4, ivec2);
754  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
755    gvec4 textureProjOffset(gsampler2D, vec3, ivec2);
756    gvec4 textureProjOffset(gsampler2D, vec4, ivec2);
757    gvec4 textureProjOffset(gsampler3D, vec4, ivec3);
758    float textureProjOffset(sampler2DShadow, vec4, ivec2);
759  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
760    gvec4 textureProjOffset(gsampler1D, vec2, int);
761    gvec4 textureProjOffset(gsampler1D, vec4, int);
762  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
763    gvec4 textureProjOffset(gsampler2DRect, vec3, ivec2);
764    gvec4 textureProjOffset(gsampler2DRect, vec4, ivec2);
765    float textureProjOffset(sampler2DRectShadow, vec4, ivec2);
766  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
767    float textureProjOffset(sampler1DShadow, vec4, int);
768  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
769    gvec4 textureLodOffset(gsampler2D, vec2, float, ivec2);
770    gvec4 textureLodOffset(gsampler3D, vec3, float, ivec3);
771    float textureLodOffset(sampler2DShadow, vec3, float, ivec2);
772    gvec4 textureLodOffset(gsampler2DArray, vec3, float, ivec2);
773  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
774    gvec4 textureLodOffset(gsampler1D, float, float, int);
775    float textureLodOffset(sampler1DShadow, vec3, float, int);
776    gvec4 textureLodOffset(gsampler1DArray, vec2, float, int);
777    float textureLodOffset(sampler1DArrayShadow, vec3, float, int);
778  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
779    gvec4 textureProjLodOffset(gsampler2D, vec3, float, ivec2);
780    gvec4 textureProjLodOffset(gsampler2D, vec4, float, ivec2);
781    gvec4 textureProjLodOffset(gsampler3D, vec4, float, ivec3);
782    float textureProjLodOffset(sampler2DShadow, vec4, float, ivec2);
783  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
784    gvec4 textureProjLodOffset(gsampler1D, vec2, float, int);
785    gvec4 textureProjLodOffset(gsampler1D, vec4, float, int);
786    float textureProjLodOffset(sampler1DShadow, vec4, float, int);
787  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
788    gvec4 texelFetchOffset(gsampler2D, ivec2, int, ivec2);
789    gvec4 texelFetchOffset(gsampler3D, ivec3, int, ivec3);
790    gvec4 texelFetchOffset(gsampler2DArray, ivec3, int, ivec2);
791  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
792    gvec4 texelFetchOffset(gsampler1D, int, int, int);
793  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
794    gvec4 texelFetchOffset(gsampler2DRect, ivec2, ivec2);
795  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
796    gvec4 texelFetchOffset(gsampler1DArray, ivec2, int, int);
797  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
798    gvec4 textureGradOffset(gsampler2D, vec2, vec2, vec2, ivec2);
799    gvec4 textureGradOffset(gsampler3D, vec3, vec3, vec3, ivec3);
800    float textureGradOffset(sampler2DShadow, vec3, vec2, vec2, ivec2);
801    gvec4 textureGradOffset(gsampler2DArray, vec3, vec2, vec2, ivec2);
802    float textureGradOffset(sampler2DArrayShadow, vec4, vec2, vec2, ivec2);
803  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
804    gvec4 textureGradOffset(gsampler1D, float, float, float, int);
805  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
806    gvec4 textureGradOffset(gsampler2DRect, vec2, vec2, vec2, ivec2);
807    float textureGradOffset(sampler2DRectShadow, vec3, vec2, vec2, ivec2);
808  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
809    float textureGradOffset(sampler1DShadow, vec3, float, float, int);
810    gvec4 textureGradOffset(gsampler1DArray, vec2, float, float, int);
811    float textureGradOffset(sampler1DArrayShadow, vec3, float, float, int);
812  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
813    gvec4 textureProjGradOffset(gsampler2D, vec3, vec2, vec2, ivec2);
814    gvec4 textureProjGradOffset(gsampler2D, vec4, vec2, vec2, ivec2);
815    gvec4 textureProjGradOffset(gsampler3D, vec4, vec3, vec3, ivec3);
816    float textureProjGradOffset(sampler2DShadow, vec4, vec2, vec2, ivec2);
817  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
818    gvec4 textureProjGradOffset(gsampler1D, vec2, float, float, int);
819    gvec4 textureProjGradOffset(gsampler1D, vec4, float, float, int);
820  DEFAULT METADATA {"glsl_level": "GLSL1_4_BUILTINS", "op": "CallBuiltInFunction"}
821    gvec4 textureProjGradOffset(gsampler2DRect, vec3, vec2, vec2, ivec2);
822    gvec4 textureProjGradOffset(gsampler2DRect, vec4, vec2, vec2, ivec2);
823    float textureProjGradOffset(sampler2DRectShadow, vec4, vec2, vec2, ivec2);
824  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
825    float textureProjGradOffset(sampler1DShadow, vec4, float, float, int);
826GROUP END TextureOffsetNoBias
827
828GROUP BEGIN TextureOffsetBias {"queryFunction": true, "shader_type": "FRAGMENT"}
829  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
830    gvec4 textureOffset(gsampler2D, vec2, ivec2, float);
831    gvec4 textureOffset(gsampler3D, vec3, ivec3, float);
832    float textureOffset(sampler2DShadow, vec3, ivec2, float);
833    gvec4 textureOffset(gsampler2DArray, vec3, ivec2, float);
834  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
835    gvec4 textureOffset(gsampler1D, float, int, float);
836    float textureOffset(sampler1DShadow, vec3, int, float);
837    gvec4 textureOffset(gsampler1DArray, vec2, int, float);
838    float textureOffset(sampler1DArrayShadow, vec3, int, float);
839  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
840    gvec4 textureProjOffset(gsampler2D, vec3, ivec2, float);
841    gvec4 textureProjOffset(gsampler2D, vec4, ivec2, float);
842    gvec4 textureProjOffset(gsampler3D, vec4, ivec3, float);
843    float textureProjOffset(sampler2DShadow, vec4, ivec2, float);
844  DEFAULT METADATA {"glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction"}
845    gvec4 textureProjOffset(gsampler1D, vec2, int, float);
846    gvec4 textureProjOffset(gsampler1D, vec4, int, float);
847    float textureProjOffset(sampler1DShadow, vec4, int, float);
848GROUP END TextureOffsetBias
849
850GROUP BEGIN EGL_image_external_essl3
851  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "OES_EGL_image_external_essl3"}
852    vec4 texture(samplerExternalOES, vec2);
853    vec4 textureProj(samplerExternalOES, vec3);
854    vec4 textureProj(samplerExternalOES, vec4);
855    ivec2 textureSize(samplerExternalOES, int);
856    vec4 texelFetch(samplerExternalOES, ivec2, int);
857GROUP END EGL_image_external_essl3
858
859GROUP BEGIN EXT_yuv_target
860  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "EXT_YUV_target"}
861    vec4 texture(samplerExternal2DY2YEXT, vec2);
862    vec4 textureProj(samplerExternal2DY2YEXT, vec3);
863    vec4 textureProj(samplerExternal2DY2YEXT, vec4);
864    vec3 rgb_2_yuv(vec3, yuvCscStandardEXT);
865    vec3 yuv_2_rgb(vec3, yuvCscStandardEXT);
866    ivec2 textureSize(samplerExternal2DY2YEXT, int);
867    vec4 texelFetch(samplerExternal2DY2YEXT, ivec2, int);
868GROUP END EXT_yuv_target
869
870GROUP BEGIN TextureGather {"queryFunction": true}
871  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
872    gvec4 textureGather(gsampler2D, vec2);
873    gvec4 textureGather(gsampler2D, vec2, int);
874    gvec4 textureGather(gsampler2DArray, vec3);
875    gvec4 textureGather(gsampler2DArray, vec3, int);
876    gvec4 textureGather(gsamplerCube, vec3);
877    gvec4 textureGather(gsamplerCube, vec3, int);
878  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
879    gvec4 textureGather(gsamplerCubeArray, vec4);
880    gvec4 textureGather(gsamplerCubeArray, vec4, int);
881    gvec4 textureGather(gsampler2DRect, vec3);
882    gvec4 textureGather(gsampler2DRect, vec3, int);
883  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
884    vec4 textureGather(sampler2DShadow, vec2);
885  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
886    vec4 textureGather(sampler2DShadow, vec2, float);
887  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
888    vec4 textureGather(sampler2DArrayShadow, vec3);
889  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
890    vec4 textureGather(sampler2DArrayShadow, vec3, float);
891  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
892    vec4 textureGather(samplerCubeShadow, vec3);
893  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
894    vec4 textureGather(samplerCubeShadow, vec3, float);
895  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
896    vec4 textureGather(samplerCubeArrayShadow, vec4, float);
897    vec4 textureGather(sampler2DRectShadow, vec2, float);
898
899    GROUP BEGIN Offset {"queryFunction": true}
900      GROUP BEGIN NoComp {"queryFunction": true}
901        DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
902          gvec4 textureGatherOffset(gsampler2D, vec2, ivec2);
903          gvec4 textureGatherOffset(gsampler2DArray, vec3, ivec2);
904          vec4 textureGatherOffset(sampler2DShadow, vec2, float, ivec2);
905          vec4 textureGatherOffset(sampler2DArrayShadow, vec3, float, ivec2);
906        DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
907          gvec4 textureGatherOffset(gsampler2DRect, vec2, ivec2);
908          vec4 textureGatherOffset(sampler2DRectShadow, vec2, float, ivec2);
909      GROUP END NoComp
910      GROUP BEGIN Comp {"queryFunction": true}
911        DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
912          gvec4 textureGatherOffset(gsampler2D, vec2, ivec2, int);
913          gvec4 textureGatherOffset(gsampler2DArray, vec3, ivec2, int);
914        DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
915          gvec4 textureGatherOffset(gsampler2DRect, vec2, ivec2, int);
916      GROUP END Comp
917    GROUP END Offset
918    GROUP BEGIN Offsets {"queryFunction": true}
919      GROUP BEGIN NoComp {"queryFunction": true}
920        DEFAULT METADATA {"essl_level": "ESSL3_2_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
921          gvec4 textureGatherOffsets(gsampler2D, vec2, ivec2[4]);
922          gvec4 textureGatherOffsets(gsampler2DArray, vec3, ivec2[4]);
923          vec4 textureGatherOffsets(sampler2DShadow, vec2, float, ivec2[4]);
924          vec4 textureGatherOffsets(sampler2DArrayShadow, vec3, float, ivec2[4]);
925        DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "EXT_gpu_shader5", "suffix": "Ext"}
926          gvec4 textureGatherOffsets(gsampler2D, vec2, ivec2[4]);
927          gvec4 textureGatherOffsets(gsampler2DArray, vec3, ivec2[4]);
928          vec4 textureGatherOffsets(sampler2DShadow, vec2, float, ivec2[4]);
929          vec4 textureGatherOffsets(sampler2DArrayShadow, vec3, float, ivec2[4]);
930        DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
931          gvec4 textureGatherOffsets(gsampler2DRect, vec2, ivec2[4]);
932          vec4 textureGatherOffsets(sampler2DRectShadow, vec2, float, ivec2[4]);
933      GROUP END NoComp
934      GROUP BEGIN Comp {"queryFunction": true}
935        DEFAULT METADATA {"essl_level": "ESSL3_2_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
936          gvec4 textureGatherOffsets(gsampler2D, vec2, ivec2[4], int);
937          gvec4 textureGatherOffsets(gsampler2DArray, vec3, ivec2[4], int);
938        DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction", "essl_extension": "EXT_gpu_shader5", "suffix": "Ext"}
939          gvec4 textureGatherOffsets(gsampler2D, vec2, ivec2[4], int);
940          gvec4 textureGatherOffsets(gsampler2DArray, vec3, ivec2[4], int);
941        DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
942          gvec4 textureGatherOffsets(gsampler2DRect, vec2, ivec2[4], int);
943      GROUP END Comp
944    GROUP END Offsets
945GROUP END TextureGather
946
947GROUP BEGIN DerivativesFS {"shader_type": "FRAGMENT"}
948  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "auto", "hasSideEffects": "true"}
949    genType dFdx(genType);
950    genType dFdy(genType);
951    genType fwidth(genType);
952  DEFAULT METADATA {"glsl_level": "GLSL4_5_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": "true"}
953    genType dFdxFine(genType);
954    genType dFdyFine(genType);
955    genType dFdxCoarse(genType);
956    genType dFdyCoarse(genType);
957    genType fwidthFine(genType);
958    genType fwidthCoarse(genType);
959GROUP END DerivativesFS
960
961GROUP BEGIN InterpolationFS {"shader_type": "FRAGMENT"}
962  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction"}
963    float interpolateAtCentroid(float);
964    vec2 interpolateAtCentroid(vec2);
965    vec3 interpolateAtCentroid(vec3);
966    vec4 interpolateAtCentroid(vec4);
967    float interpolateAtSample(float, int);
968    vec2 interpolateAtSample(vec2, int);
969    vec3 interpolateAtSample(vec3, int);
970    vec4 interpolateAtSample(vec4, int);
971    float interpolateAtOffset(float, vec2);
972    vec2 interpolateAtOffset(vec2, vec2);
973    vec3 interpolateAtOffset(vec3, vec2);
974    vec4 interpolateAtOffset(vec4, vec2);
975GROUP END InterpolationFS
976
977GROUP BEGIN AtomicCounter
978  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
979    uint atomicCounter(atomic_uint);
980    uint atomicCounterIncrement(atomic_uint);
981    uint atomicCounterDecrement(atomic_uint);
982  DEFAULT METADATA {"glsl_level": "GLSL4_6_BUILTINS", "op": "CallBuiltInFunction"}
983    uint atomicCounterAdd(atomic_uint, uint);
984    uint atomicCounterSubtract(atomic_uint, uint);
985    uint atomicCounterMin(atomic_uint, uint);
986    uint atomicCounterMax(atomic_uint, uint);
987    uint atomicCounterAnd(atomic_uint, uint);
988    uint atomicCounterOr(atomic_uint, uint);
989    uint atomicCounterXor(atomic_uint, uint);
990    uint atomicCounterExchange(atomic_uint, uint);
991    uint atomicCounterCompSwap(atomic_uint, uint, uint);
992GROUP END AtomicCounter
993
994GROUP BEGIN AtomicMemory {"queryFunction": true}
995  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_3_BUILTINS", "op": "auto"}
996    uint atomicAdd(inout uint, uint);
997    int atomicAdd(inout int, int);
998    uint atomicMin(inout uint, uint);
999    int atomicMin(inout int, int);
1000    uint atomicMax(inout uint, uint);
1001    int atomicMax(inout int, int);
1002    uint atomicAnd(inout uint, uint);
1003    int atomicAnd(inout int, int);
1004    uint atomicOr(inout uint, uint);
1005    int atomicOr(inout int, int);
1006    uint atomicXor(inout uint, uint);
1007    int atomicXor(inout int, int);
1008    uint atomicExchange(inout uint, uint);
1009    int atomicExchange(inout int, int);
1010    uint atomicCompSwap(inout uint, uint, uint);
1011    int atomicCompSwap(inout int, int, int);
1012GROUP END AtomicMemory
1013
1014GROUP BEGIN Image {"queryFunction": true}
1015    GROUP BEGIN Store {"queryFunction": true}
1016      DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
1017        void imageStore(gimage2D, ivec2, gvec4);
1018        void imageStore(gimage3D, ivec3, gvec4);
1019        void imageStore(gimage2DArray, ivec3, gvec4);
1020        void imageStore(gimageCube, ivec3, gvec4);
1021
1022      // These functions are part of OES/EXT_texture_cube_map.
1023      // There's no way to mark alternative extensions for builtins, so these are marked with none.
1024      // TODO(anglebug.com/4589)
1025      DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
1026        gvec4 imageStore(gimageCubeArray, ivec3, gvec4);
1027
1028      DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
1029        void imageStore(writeonly IMAGE_PARAMS, gvec4);
1030    GROUP END Store
1031    GROUP BEGIN Load {"queryFunction": true}
1032      DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
1033        gvec4 imageLoad(gimage2D, ivec2);
1034        gvec4 imageLoad(gimage3D, ivec3);
1035        gvec4 imageLoad(gimage2DArray, ivec3);
1036        gvec4 imageLoad(gimageCube, ivec3);
1037
1038      // These functions are part of OES/EXT_texture_cube_map.
1039      // There's no way to mark alternative extensions for builtins, so these are marked with none.
1040      // TODO(anglebug.com/4589)
1041      DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
1042        gvec4 imageLoad(gimageCubeArray, ivec3);
1043
1044      DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
1045        gvec4 imageLoad(readonly IMAGE_PARAMS);
1046    GROUP END Load
1047  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
1048    ivec2 imageSize(gimage2D);
1049    ivec3 imageSize(gimage3D);
1050    ivec3 imageSize(gimage2DArray);
1051    ivec2 imageSize(gimageCube);
1052
1053  // These functions are part of OES/EXT_texture_cube_map.
1054  // There's no way to mark alternative extensions for builtins, so these are marked with none.
1055  // TODO(anglebug.com/4589)
1056  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "CallBuiltInFunction"}
1057    ivec3 imageSize(gimageCubeArray);
1058
1059  DEFAULT METADATA {"glsl_level": "GLSL4_3_BUILTINS", "op": "CallBuiltInFunction"}
1060    int imageSize(readonly writeonly gimage1D);
1061    ivec2 imageSize(readonly writeonly gimage2D);
1062    ivec3 imageSize(readonly writeonly gimage3D);
1063    ivec2 imageSize(readonly writeonly gimageCube);
1064    ivec3 imageSize(readonly writeonly gimageCubeArray);
1065    ivec2 imageSize(readonly writeonly gimageRect);
1066    ivec2 imageSize(readonly writeonly gimage1DArray);
1067    ivec3 imageSize(readonly writeonly gimage2DArray);
1068    int imageSize(readonly writeonly gimageBuffer);
1069    ivec2 imageSize(readonly writeonly gimage2DMS);
1070    ivec3 imageSize(readonly writeonly gimage2DMSArray);
1071  DEFAULT METADATA {"glsl_level": "GLSL4_5_BUILTINS", "op": "CallBuiltInFunction"}
1072    int imageSamples(readonly writeonly gimage2DMS);
1073    int imageSamples(readonly writeonly gimage2DMSArray);
1074  DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
1075    uint imageAtomicAdd(IMAGE_PARAMS, uint);
1076    int imageAtomicAdd(IMAGE_PARAMS, int);
1077    uint imageAtomicMin(IMAGE_PARAMS, uint);
1078    int imageAtomicMin(IMAGE_PARAMS, int);
1079    uint imageAtomicMax(IMAGE_PARAMS, uint);
1080    int imageAtomicMax(IMAGE_PARAMS, int);
1081    uint imageAtomicAnd(IMAGE_PARAMS, uint);
1082    int imageAtomicAnd(IMAGE_PARAMS, int);
1083    uint imageAtomicOr(IMAGE_PARAMS, uint);
1084    int imageAtomicOr(IMAGE_PARAMS, int);
1085    uint imageAtomicXor(IMAGE_PARAMS, uint);
1086    int imageAtomicXor(IMAGE_PARAMS, int);
1087    uint imageAtomicExchange(IMAGE_PARAMS, uint);
1088    int imageAtomicExchange(IMAGE_PARAMS, int);
1089  DEFAULT METADATA {"glsl_level": "GLSL4_5_BUILTINS", "op": "CallBuiltInFunction"}
1090    int imageAtomicExchange(IMAGE_PARAMS, float);
1091  DEFAULT METADATA {"glsl_level": "GLSL4_2_BUILTINS", "op": "CallBuiltInFunction"}
1092    uint imageAtomicCompSwap(IMAGE_PARAMS, uint, uint);
1093    int imageAtomicCompSwap(IMAGE_PARAMS, int, int);
1094GROUP END Image
1095
1096GROUP BEGIN Noise
1097  DEFAULT METADATA {"glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction"}
1098    float noise1(genType);
1099    vec2 noise2(genType);
1100    vec3 noise3(genType);
1101    vec4 noise4(genType);
1102GROUP END Noise
1103
1104GROUP BEGIN Barrier
1105  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_2_BUILTINS", "op": "auto", "hasSideEffects": true}
1106    void memoryBarrier();
1107  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_3_BUILTINS", "op": "auto", "hasSideEffects": true}
1108    void memoryBarrierAtomicCounter();
1109    void memoryBarrierBuffer();
1110    void memoryBarrierImage();
1111GROUP END Barrier
1112
1113GROUP BEGIN ESSL310CS {"shader_type": "COMPUTE"}
1114  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_BUILTINS", "op": "auto", "hasSideEffects": true}
1115    void barrier();
1116  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "glsl_level": "GLSL4_3_BUILTINS", "op": "auto", "hasSideEffects": true}
1117    void memoryBarrierShared();
1118    void groupMemoryBarrier();
1119GROUP END ESSL310CS
1120
1121GROUP BEGIN ESSL310GS {"shader_type": "GEOMETRY_EXT"}
1122  DEFAULT METADATA {"essl_level": "ESSL3_1_BUILTINS", "op": "auto", "essl_extension": "EXT_geometry_shader", "hasSideEffects": true}
1123    void EmitVertex();
1124    void EndPrimitive();
1125GROUP END ESSL310GS
1126
1127GROUP BEGIN GLSLGS {"shader_type": "GEOMETRY"}
1128  DEFAULT METADATA {"glsl_level": "GLSL4_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": "true"}
1129    void EmitStreamVertex(int);
1130    void EndStreamPrimitive(int);
1131  DEFAULT METADATA {"glsl_level": "GLSL1_5_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": "true"}
1132    void EmitVertex();
1133    void EndPrimitive();
1134GROUP END GLSLGS
1135
1136GROUP BEGIN SubpassInput
1137  DEFAULT METADATA {"glsl_level": "GLSL4_6_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": true}
1138    gvec4 subpassLoad(gsubpassInput);
1139    gvec4 subpassLoad(gsubpassInputMS, int);
1140GROUP END SubpassInput
1141
1142GROUP BEGIN ShaderInvocationGroup
1143  DEFAULT METADATA {"glsl_level": "GLSL4_6_BUILTINS", "op": "CallBuiltInFunction", "hasSideEffects": true}
1144    bool anyInvocation(bool);
1145    bool allInvocations(bool);
1146    bool allInvocationsEqual(bool);
1147GROUP END ShaderInvocationGroup
1148
1149GROUP BEGIN WEBGLVideoTexture
1150  DEFAULT METADATA {"essl_level": "ESSL1_BUILTINS", "glsl_level": "COMMON_BUILTINS", "op": "CallBuiltInFunction", "extension": "WEBGL_video_texture"}
1151      vec4 textureVideoWEBGL(samplerVideoWEBGL, vec2);
1152  DEFAULT METADATA {"essl_level": "ESSL3_BUILTINS", "glsl_level": "GLSL1_3_BUILTINS", "op": "CallBuiltInFunction", "extension": "WEBGL_video_texture"}
1153    vec4 texture(samplerVideoWEBGL, vec2);
1154GROUP END WEBGLVideoTexture
1155