1/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
5 *
6 * The origin of this IDL file is
7 * https://www.khronos.org/registry/webgl/specs/latest/webgl.idl
8 *
9 * Copyright © 2012 Khronos Group
10 */
11
12// WebGL IDL definitions scraped from the Khronos specification:
13// https://www.khronos.org/registry/webgl/specs/latest/
14//
15// This IDL depends on the typed array specification defined at:
16// https://www.khronos.org/registry/typedarray/specs/latest/typedarrays.idl
17
18typedef unsigned long  GLenum;
19typedef boolean        GLboolean;
20typedef unsigned long  GLbitfield;
21typedef byte           GLbyte;         /* 'byte' should be a signed 8 bit type. */
22typedef short          GLshort;
23typedef long           GLint;
24typedef long           GLsizei;
25typedef long long      GLintptr;
26typedef long long      GLsizeiptr;
27// Ideally the typedef below would use 'unsigned byte', but that doesn't currently exist in Web IDL.
28typedef octet          GLubyte;        /* 'octet' should be an unsigned 8 bit type. */
29typedef unsigned short GLushort;
30typedef unsigned long  GLuint;
31typedef unrestricted float GLfloat;
32typedef unrestricted float GLclampf;
33typedef unsigned long long GLuint64EXT;
34
35dictionary WebGLContextAttributes {
36    // boolean alpha = true;
37    // We deviate from the spec here.
38    // If alpha isn't specified, we rely on a pref ("webgl.default-no-alpha")
39    GLboolean alpha;
40    GLboolean depth = true;
41    GLboolean stencil = false;
42    GLboolean antialias = true;
43    GLboolean premultipliedAlpha = true;
44    GLboolean preserveDrawingBuffer = false;
45    GLboolean failIfMajorPerformanceCaveat = false;
46};
47
48[Exposed=(Window,Worker),
49 Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
50interface WebGLBuffer {
51};
52
53[Exposed=(Window,Worker),
54 Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
55interface WebGLFramebuffer {
56};
57
58[Exposed=(Window,Worker),
59 Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
60interface WebGLProgram {
61};
62
63[Exposed=(Window,Worker),
64 Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
65interface WebGLRenderbuffer {
66};
67
68[Exposed=(Window,Worker),
69 Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
70interface WebGLShader {
71};
72
73[Exposed=(Window,Worker),
74 Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
75interface WebGLTexture {
76};
77
78[Exposed=(Window,Worker),
79 Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
80interface WebGLUniformLocation {
81};
82
83interface WebGLVertexArrayObject {
84};
85
86[Exposed=(Window,Worker),
87 Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
88interface WebGLActiveInfo {
89    readonly attribute GLint size;
90    readonly attribute GLenum type;
91    readonly attribute DOMString name;
92};
93
94[Exposed=(Window,Worker),
95 Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
96interface WebGLShaderPrecisionFormat {
97    readonly attribute GLint rangeMin;
98    readonly attribute GLint rangeMax;
99    readonly attribute GLint precision;
100};
101
102typedef (Float32Array or sequence<GLfloat>) Float32List;
103typedef (Int32Array or sequence<GLint>) Int32List;
104
105// Shared interface for the things that WebGLRenderingContext and
106// WebGL2RenderingContext have in common.  This doesn't have all the things they
107// have in common, because we don't support splitting multiple overloads of the
108// same method across separate interfaces and pulling them in with "implements".
109[Exposed=(Window, Worker), NoInterfaceObject]
110interface WebGLRenderingContextBase {
111    /* ClearBufferMask */
112    const GLenum DEPTH_BUFFER_BIT               = 0x00000100;
113    const GLenum STENCIL_BUFFER_BIT             = 0x00000400;
114    const GLenum COLOR_BUFFER_BIT               = 0x00004000;
115
116    /* BeginMode */
117    const GLenum POINTS                         = 0x0000;
118    const GLenum LINES                          = 0x0001;
119    const GLenum LINE_LOOP                      = 0x0002;
120    const GLenum LINE_STRIP                     = 0x0003;
121    const GLenum TRIANGLES                      = 0x0004;
122    const GLenum TRIANGLE_STRIP                 = 0x0005;
123    const GLenum TRIANGLE_FAN                   = 0x0006;
124
125    /* AlphaFunction (not supported in ES20) */
126    /*      NEVER */
127    /*      LESS */
128    /*      EQUAL */
129    /*      LEQUAL */
130    /*      GREATER */
131    /*      NOTEQUAL */
132    /*      GEQUAL */
133    /*      ALWAYS */
134
135    /* BlendingFactorDest */
136    const GLenum ZERO                           = 0;
137    const GLenum ONE                            = 1;
138    const GLenum SRC_COLOR                      = 0x0300;
139    const GLenum ONE_MINUS_SRC_COLOR            = 0x0301;
140    const GLenum SRC_ALPHA                      = 0x0302;
141    const GLenum ONE_MINUS_SRC_ALPHA            = 0x0303;
142    const GLenum DST_ALPHA                      = 0x0304;
143    const GLenum ONE_MINUS_DST_ALPHA            = 0x0305;
144
145    /* BlendingFactorSrc */
146    /*      ZERO */
147    /*      ONE */
148    const GLenum DST_COLOR                      = 0x0306;
149    const GLenum ONE_MINUS_DST_COLOR            = 0x0307;
150    const GLenum SRC_ALPHA_SATURATE             = 0x0308;
151    /*      SRC_ALPHA */
152    /*      ONE_MINUS_SRC_ALPHA */
153    /*      DST_ALPHA */
154    /*      ONE_MINUS_DST_ALPHA */
155
156    /* BlendEquationSeparate */
157    const GLenum FUNC_ADD                       = 0x8006;
158    const GLenum BLEND_EQUATION                 = 0x8009;
159    const GLenum BLEND_EQUATION_RGB             = 0x8009;   /* same as BLEND_EQUATION */
160    const GLenum BLEND_EQUATION_ALPHA           = 0x883D;
161
162    /* BlendSubtract */
163    const GLenum FUNC_SUBTRACT                  = 0x800A;
164    const GLenum FUNC_REVERSE_SUBTRACT          = 0x800B;
165
166    /* Separate Blend Functions */
167    const GLenum BLEND_DST_RGB                  = 0x80C8;
168    const GLenum BLEND_SRC_RGB                  = 0x80C9;
169    const GLenum BLEND_DST_ALPHA                = 0x80CA;
170    const GLenum BLEND_SRC_ALPHA                = 0x80CB;
171    const GLenum CONSTANT_COLOR                 = 0x8001;
172    const GLenum ONE_MINUS_CONSTANT_COLOR       = 0x8002;
173    const GLenum CONSTANT_ALPHA                 = 0x8003;
174    const GLenum ONE_MINUS_CONSTANT_ALPHA       = 0x8004;
175    const GLenum BLEND_COLOR                    = 0x8005;
176
177    /* Buffer Objects */
178    const GLenum ARRAY_BUFFER                   = 0x8892;
179    const GLenum ELEMENT_ARRAY_BUFFER           = 0x8893;
180    const GLenum ARRAY_BUFFER_BINDING           = 0x8894;
181    const GLenum ELEMENT_ARRAY_BUFFER_BINDING   = 0x8895;
182
183    const GLenum STREAM_DRAW                    = 0x88E0;
184    const GLenum STATIC_DRAW                    = 0x88E4;
185    const GLenum DYNAMIC_DRAW                   = 0x88E8;
186
187    const GLenum BUFFER_SIZE                    = 0x8764;
188    const GLenum BUFFER_USAGE                   = 0x8765;
189
190    const GLenum CURRENT_VERTEX_ATTRIB          = 0x8626;
191
192    /* CullFaceMode */
193    const GLenum FRONT                          = 0x0404;
194    const GLenum BACK                           = 0x0405;
195    const GLenum FRONT_AND_BACK                 = 0x0408;
196
197    /* DepthFunction */
198    /*      NEVER */
199    /*      LESS */
200    /*      EQUAL */
201    /*      LEQUAL */
202    /*      GREATER */
203    /*      NOTEQUAL */
204    /*      GEQUAL */
205    /*      ALWAYS */
206
207    /* EnableCap */
208    /* TEXTURE_2D */
209    const GLenum CULL_FACE                      = 0x0B44;
210    const GLenum BLEND                          = 0x0BE2;
211    const GLenum DITHER                         = 0x0BD0;
212    const GLenum STENCIL_TEST                   = 0x0B90;
213    const GLenum DEPTH_TEST                     = 0x0B71;
214    const GLenum SCISSOR_TEST                   = 0x0C11;
215    const GLenum POLYGON_OFFSET_FILL            = 0x8037;
216    const GLenum SAMPLE_ALPHA_TO_COVERAGE       = 0x809E;
217    const GLenum SAMPLE_COVERAGE                = 0x80A0;
218
219    /* ErrorCode */
220    const GLenum NO_ERROR                       = 0;
221    const GLenum INVALID_ENUM                   = 0x0500;
222    const GLenum INVALID_VALUE                  = 0x0501;
223    const GLenum INVALID_OPERATION              = 0x0502;
224    const GLenum OUT_OF_MEMORY                  = 0x0505;
225
226    /* FrontFaceDirection */
227    const GLenum CW                             = 0x0900;
228    const GLenum CCW                            = 0x0901;
229
230    /* GetPName */
231    const GLenum LINE_WIDTH                     = 0x0B21;
232    const GLenum ALIASED_POINT_SIZE_RANGE       = 0x846D;
233    const GLenum ALIASED_LINE_WIDTH_RANGE       = 0x846E;
234    const GLenum CULL_FACE_MODE                 = 0x0B45;
235    const GLenum FRONT_FACE                     = 0x0B46;
236    const GLenum DEPTH_RANGE                    = 0x0B70;
237    const GLenum DEPTH_WRITEMASK                = 0x0B72;
238    const GLenum DEPTH_CLEAR_VALUE              = 0x0B73;
239    const GLenum DEPTH_FUNC                     = 0x0B74;
240    const GLenum STENCIL_CLEAR_VALUE            = 0x0B91;
241    const GLenum STENCIL_FUNC                   = 0x0B92;
242    const GLenum STENCIL_FAIL                   = 0x0B94;
243    const GLenum STENCIL_PASS_DEPTH_FAIL        = 0x0B95;
244    const GLenum STENCIL_PASS_DEPTH_PASS        = 0x0B96;
245    const GLenum STENCIL_REF                    = 0x0B97;
246    const GLenum STENCIL_VALUE_MASK             = 0x0B93;
247    const GLenum STENCIL_WRITEMASK              = 0x0B98;
248    const GLenum STENCIL_BACK_FUNC              = 0x8800;
249    const GLenum STENCIL_BACK_FAIL              = 0x8801;
250    const GLenum STENCIL_BACK_PASS_DEPTH_FAIL   = 0x8802;
251    const GLenum STENCIL_BACK_PASS_DEPTH_PASS   = 0x8803;
252    const GLenum STENCIL_BACK_REF               = 0x8CA3;
253    const GLenum STENCIL_BACK_VALUE_MASK        = 0x8CA4;
254    const GLenum STENCIL_BACK_WRITEMASK         = 0x8CA5;
255    const GLenum VIEWPORT                       = 0x0BA2;
256    const GLenum SCISSOR_BOX                    = 0x0C10;
257    /*      SCISSOR_TEST */
258    const GLenum COLOR_CLEAR_VALUE              = 0x0C22;
259    const GLenum COLOR_WRITEMASK                = 0x0C23;
260    const GLenum UNPACK_ALIGNMENT               = 0x0CF5;
261    const GLenum PACK_ALIGNMENT                 = 0x0D05;
262    const GLenum MAX_TEXTURE_SIZE               = 0x0D33;
263    const GLenum MAX_VIEWPORT_DIMS              = 0x0D3A;
264    const GLenum SUBPIXEL_BITS                  = 0x0D50;
265    const GLenum RED_BITS                       = 0x0D52;
266    const GLenum GREEN_BITS                     = 0x0D53;
267    const GLenum BLUE_BITS                      = 0x0D54;
268    const GLenum ALPHA_BITS                     = 0x0D55;
269    const GLenum DEPTH_BITS                     = 0x0D56;
270    const GLenum STENCIL_BITS                   = 0x0D57;
271    const GLenum POLYGON_OFFSET_UNITS           = 0x2A00;
272    /*      POLYGON_OFFSET_FILL */
273    const GLenum POLYGON_OFFSET_FACTOR          = 0x8038;
274    const GLenum TEXTURE_BINDING_2D             = 0x8069;
275    const GLenum SAMPLE_BUFFERS                 = 0x80A8;
276    const GLenum SAMPLES                        = 0x80A9;
277    const GLenum SAMPLE_COVERAGE_VALUE          = 0x80AA;
278    const GLenum SAMPLE_COVERAGE_INVERT         = 0x80AB;
279
280    /* GetTextureParameter */
281    /*      TEXTURE_MAG_FILTER */
282    /*      TEXTURE_MIN_FILTER */
283    /*      TEXTURE_WRAP_S */
284    /*      TEXTURE_WRAP_T */
285
286    const GLenum COMPRESSED_TEXTURE_FORMATS     = 0x86A3;
287
288    /* HintMode */
289    const GLenum DONT_CARE                      = 0x1100;
290    const GLenum FASTEST                        = 0x1101;
291    const GLenum NICEST                         = 0x1102;
292
293    /* HintTarget */
294    const GLenum GENERATE_MIPMAP_HINT            = 0x8192;
295
296    /* DataType */
297    const GLenum BYTE                           = 0x1400;
298    const GLenum UNSIGNED_BYTE                  = 0x1401;
299    const GLenum SHORT                          = 0x1402;
300    const GLenum UNSIGNED_SHORT                 = 0x1403;
301    const GLenum INT                            = 0x1404;
302    const GLenum UNSIGNED_INT                   = 0x1405;
303    const GLenum FLOAT                          = 0x1406;
304
305    /* PixelFormat */
306    const GLenum DEPTH_COMPONENT                = 0x1902;
307    const GLenum ALPHA                          = 0x1906;
308    const GLenum RGB                            = 0x1907;
309    const GLenum RGBA                           = 0x1908;
310    const GLenum LUMINANCE                      = 0x1909;
311    const GLenum LUMINANCE_ALPHA                = 0x190A;
312
313    /* PixelType */
314    /*      UNSIGNED_BYTE */
315    const GLenum UNSIGNED_SHORT_4_4_4_4         = 0x8033;
316    const GLenum UNSIGNED_SHORT_5_5_5_1         = 0x8034;
317    const GLenum UNSIGNED_SHORT_5_6_5           = 0x8363;
318
319    /* Shaders */
320    const GLenum FRAGMENT_SHADER                  = 0x8B30;
321    const GLenum VERTEX_SHADER                    = 0x8B31;
322    const GLenum MAX_VERTEX_ATTRIBS               = 0x8869;
323    const GLenum MAX_VERTEX_UNIFORM_VECTORS       = 0x8DFB;
324    const GLenum MAX_VARYING_VECTORS              = 0x8DFC;
325    const GLenum MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
326    const GLenum MAX_VERTEX_TEXTURE_IMAGE_UNITS   = 0x8B4C;
327    const GLenum MAX_TEXTURE_IMAGE_UNITS          = 0x8872;
328    const GLenum MAX_FRAGMENT_UNIFORM_VECTORS     = 0x8DFD;
329    const GLenum SHADER_TYPE                      = 0x8B4F;
330    const GLenum DELETE_STATUS                    = 0x8B80;
331    const GLenum LINK_STATUS                      = 0x8B82;
332    const GLenum VALIDATE_STATUS                  = 0x8B83;
333    const GLenum ATTACHED_SHADERS                 = 0x8B85;
334    const GLenum ACTIVE_UNIFORMS                  = 0x8B86;
335    const GLenum ACTIVE_ATTRIBUTES                = 0x8B89;
336    const GLenum SHADING_LANGUAGE_VERSION         = 0x8B8C;
337    const GLenum CURRENT_PROGRAM                  = 0x8B8D;
338
339    /* StencilFunction */
340    const GLenum NEVER                          = 0x0200;
341    const GLenum LESS                           = 0x0201;
342    const GLenum EQUAL                          = 0x0202;
343    const GLenum LEQUAL                         = 0x0203;
344    const GLenum GREATER                        = 0x0204;
345    const GLenum NOTEQUAL                       = 0x0205;
346    const GLenum GEQUAL                         = 0x0206;
347    const GLenum ALWAYS                         = 0x0207;
348
349    /* StencilOp */
350    /*      ZERO */
351    const GLenum KEEP                           = 0x1E00;
352    const GLenum REPLACE                        = 0x1E01;
353    const GLenum INCR                           = 0x1E02;
354    const GLenum DECR                           = 0x1E03;
355    const GLenum INVERT                         = 0x150A;
356    const GLenum INCR_WRAP                      = 0x8507;
357    const GLenum DECR_WRAP                      = 0x8508;
358
359    /* StringName */
360    const GLenum VENDOR                         = 0x1F00;
361    const GLenum RENDERER                       = 0x1F01;
362    const GLenum VERSION                        = 0x1F02;
363
364    /* TextureMagFilter */
365    const GLenum NEAREST                        = 0x2600;
366    const GLenum LINEAR                         = 0x2601;
367
368    /* TextureMinFilter */
369    /*      NEAREST */
370    /*      LINEAR */
371    const GLenum NEAREST_MIPMAP_NEAREST         = 0x2700;
372    const GLenum LINEAR_MIPMAP_NEAREST          = 0x2701;
373    const GLenum NEAREST_MIPMAP_LINEAR          = 0x2702;
374    const GLenum LINEAR_MIPMAP_LINEAR           = 0x2703;
375
376    /* TextureParameterName */
377    const GLenum TEXTURE_MAG_FILTER             = 0x2800;
378    const GLenum TEXTURE_MIN_FILTER             = 0x2801;
379    const GLenum TEXTURE_WRAP_S                 = 0x2802;
380    const GLenum TEXTURE_WRAP_T                 = 0x2803;
381
382    /* TextureTarget */
383    const GLenum TEXTURE_2D                     = 0x0DE1;
384    const GLenum TEXTURE                        = 0x1702;
385
386    const GLenum TEXTURE_CUBE_MAP               = 0x8513;
387    const GLenum TEXTURE_BINDING_CUBE_MAP       = 0x8514;
388    const GLenum TEXTURE_CUBE_MAP_POSITIVE_X    = 0x8515;
389    const GLenum TEXTURE_CUBE_MAP_NEGATIVE_X    = 0x8516;
390    const GLenum TEXTURE_CUBE_MAP_POSITIVE_Y    = 0x8517;
391    const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Y    = 0x8518;
392    const GLenum TEXTURE_CUBE_MAP_POSITIVE_Z    = 0x8519;
393    const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Z    = 0x851A;
394    const GLenum MAX_CUBE_MAP_TEXTURE_SIZE      = 0x851C;
395
396    /* TextureUnit */
397    const GLenum TEXTURE0                       = 0x84C0;
398    const GLenum TEXTURE1                       = 0x84C1;
399    const GLenum TEXTURE2                       = 0x84C2;
400    const GLenum TEXTURE3                       = 0x84C3;
401    const GLenum TEXTURE4                       = 0x84C4;
402    const GLenum TEXTURE5                       = 0x84C5;
403    const GLenum TEXTURE6                       = 0x84C6;
404    const GLenum TEXTURE7                       = 0x84C7;
405    const GLenum TEXTURE8                       = 0x84C8;
406    const GLenum TEXTURE9                       = 0x84C9;
407    const GLenum TEXTURE10                      = 0x84CA;
408    const GLenum TEXTURE11                      = 0x84CB;
409    const GLenum TEXTURE12                      = 0x84CC;
410    const GLenum TEXTURE13                      = 0x84CD;
411    const GLenum TEXTURE14                      = 0x84CE;
412    const GLenum TEXTURE15                      = 0x84CF;
413    const GLenum TEXTURE16                      = 0x84D0;
414    const GLenum TEXTURE17                      = 0x84D1;
415    const GLenum TEXTURE18                      = 0x84D2;
416    const GLenum TEXTURE19                      = 0x84D3;
417    const GLenum TEXTURE20                      = 0x84D4;
418    const GLenum TEXTURE21                      = 0x84D5;
419    const GLenum TEXTURE22                      = 0x84D6;
420    const GLenum TEXTURE23                      = 0x84D7;
421    const GLenum TEXTURE24                      = 0x84D8;
422    const GLenum TEXTURE25                      = 0x84D9;
423    const GLenum TEXTURE26                      = 0x84DA;
424    const GLenum TEXTURE27                      = 0x84DB;
425    const GLenum TEXTURE28                      = 0x84DC;
426    const GLenum TEXTURE29                      = 0x84DD;
427    const GLenum TEXTURE30                      = 0x84DE;
428    const GLenum TEXTURE31                      = 0x84DF;
429    const GLenum ACTIVE_TEXTURE                 = 0x84E0;
430
431    /* TextureWrapMode */
432    const GLenum REPEAT                         = 0x2901;
433    const GLenum CLAMP_TO_EDGE                  = 0x812F;
434    const GLenum MIRRORED_REPEAT                = 0x8370;
435
436    /* Uniform Types */
437    const GLenum FLOAT_VEC2                     = 0x8B50;
438    const GLenum FLOAT_VEC3                     = 0x8B51;
439    const GLenum FLOAT_VEC4                     = 0x8B52;
440    const GLenum INT_VEC2                       = 0x8B53;
441    const GLenum INT_VEC3                       = 0x8B54;
442    const GLenum INT_VEC4                       = 0x8B55;
443    const GLenum BOOL                           = 0x8B56;
444    const GLenum BOOL_VEC2                      = 0x8B57;
445    const GLenum BOOL_VEC3                      = 0x8B58;
446    const GLenum BOOL_VEC4                      = 0x8B59;
447    const GLenum FLOAT_MAT2                     = 0x8B5A;
448    const GLenum FLOAT_MAT3                     = 0x8B5B;
449    const GLenum FLOAT_MAT4                     = 0x8B5C;
450    const GLenum SAMPLER_2D                     = 0x8B5E;
451    const GLenum SAMPLER_CUBE                   = 0x8B60;
452
453    /* Vertex Arrays */
454    const GLenum VERTEX_ATTRIB_ARRAY_ENABLED        = 0x8622;
455    const GLenum VERTEX_ATTRIB_ARRAY_SIZE           = 0x8623;
456    const GLenum VERTEX_ATTRIB_ARRAY_STRIDE         = 0x8624;
457    const GLenum VERTEX_ATTRIB_ARRAY_TYPE           = 0x8625;
458    const GLenum VERTEX_ATTRIB_ARRAY_NORMALIZED     = 0x886A;
459    const GLenum VERTEX_ATTRIB_ARRAY_POINTER        = 0x8645;
460    const GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
461
462    /* Read Format */
463    const GLenum IMPLEMENTATION_COLOR_READ_TYPE   = 0x8B9A;
464    const GLenum IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B;
465
466    /* Shader Source */
467    const GLenum COMPILE_STATUS                 = 0x8B81;
468
469    /* Shader Precision-Specified Types */
470    const GLenum LOW_FLOAT                      = 0x8DF0;
471    const GLenum MEDIUM_FLOAT                   = 0x8DF1;
472    const GLenum HIGH_FLOAT                     = 0x8DF2;
473    const GLenum LOW_INT                        = 0x8DF3;
474    const GLenum MEDIUM_INT                     = 0x8DF4;
475    const GLenum HIGH_INT                       = 0x8DF5;
476
477    /* Framebuffer Object. */
478    const GLenum FRAMEBUFFER                    = 0x8D40;
479    const GLenum RENDERBUFFER                   = 0x8D41;
480
481    const GLenum RGBA4                          = 0x8056;
482    const GLenum RGB5_A1                        = 0x8057;
483    const GLenum RGB565                         = 0x8D62;
484    const GLenum DEPTH_COMPONENT16              = 0x81A5;
485    const GLenum STENCIL_INDEX                  = 0x1901;
486    const GLenum STENCIL_INDEX8                 = 0x8D48;
487    const GLenum DEPTH_STENCIL                  = 0x84F9;
488
489    const GLenum RENDERBUFFER_WIDTH             = 0x8D42;
490    const GLenum RENDERBUFFER_HEIGHT            = 0x8D43;
491    const GLenum RENDERBUFFER_INTERNAL_FORMAT   = 0x8D44;
492    const GLenum RENDERBUFFER_RED_SIZE          = 0x8D50;
493    const GLenum RENDERBUFFER_GREEN_SIZE        = 0x8D51;
494    const GLenum RENDERBUFFER_BLUE_SIZE         = 0x8D52;
495    const GLenum RENDERBUFFER_ALPHA_SIZE        = 0x8D53;
496    const GLenum RENDERBUFFER_DEPTH_SIZE        = 0x8D54;
497    const GLenum RENDERBUFFER_STENCIL_SIZE      = 0x8D55;
498
499    const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE           = 0x8CD0;
500    const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_NAME           = 0x8CD1;
501    const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL         = 0x8CD2;
502    const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
503
504    const GLenum COLOR_ATTACHMENT0              = 0x8CE0;
505    const GLenum DEPTH_ATTACHMENT               = 0x8D00;
506    const GLenum STENCIL_ATTACHMENT             = 0x8D20;
507    const GLenum DEPTH_STENCIL_ATTACHMENT       = 0x821A;
508
509    const GLenum NONE                           = 0;
510
511    const GLenum FRAMEBUFFER_COMPLETE                      = 0x8CD5;
512    const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT         = 0x8CD6;
513    const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
514    const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS         = 0x8CD9;
515    const GLenum FRAMEBUFFER_UNSUPPORTED                   = 0x8CDD;
516
517    const GLenum FRAMEBUFFER_BINDING            = 0x8CA6;
518    const GLenum RENDERBUFFER_BINDING           = 0x8CA7;
519    const GLenum MAX_RENDERBUFFER_SIZE          = 0x84E8;
520
521    const GLenum INVALID_FRAMEBUFFER_OPERATION  = 0x0506;
522
523    /* WebGL-specific enums */
524    const GLenum UNPACK_FLIP_Y_WEBGL            = 0x9240;
525    const GLenum UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
526    const GLenum CONTEXT_LOST_WEBGL             = 0x9242;
527    const GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
528    const GLenum BROWSER_DEFAULT_WEBGL          = 0x9244;
529
530    // The canvas might actually be null in some cases, apparently.
531    readonly attribute (HTMLCanvasElement or OffscreenCanvas)? canvas;
532    readonly attribute GLsizei drawingBufferWidth;
533    readonly attribute GLsizei drawingBufferHeight;
534
535    [WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
536    [WebGLHandlesContextLoss] boolean isContextLost();
537
538    [NeedsCallerType]
539    sequence<DOMString>? getSupportedExtensions();
540
541    [Throws, NeedsCallerType]
542    object? getExtension(DOMString name);
543
544    void activeTexture(GLenum texture);
545    void attachShader(WebGLProgram program, WebGLShader shader);
546    void bindAttribLocation(WebGLProgram program, GLuint index, DOMString name);
547    void bindBuffer(GLenum target, WebGLBuffer? buffer);
548    void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer);
549    void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer);
550    void bindTexture(GLenum target, WebGLTexture? texture);
551    void blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
552    void blendEquation(GLenum mode);
553    void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
554    void blendFunc(GLenum sfactor, GLenum dfactor);
555    void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
556                           GLenum srcAlpha, GLenum dstAlpha);
557
558    [WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target);
559    void clear(GLbitfield mask);
560    void clearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
561    void clearDepth(GLclampf depth);
562    void clearStencil(GLint s);
563    void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
564    void compileShader(WebGLShader shader);
565
566    void copyTexImage2D(GLenum target, GLint level, GLenum internalformat,
567                        GLint x, GLint y, GLsizei width, GLsizei height,
568                        GLint border);
569    void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
570                           GLint x, GLint y, GLsizei width, GLsizei height);
571
572    WebGLBuffer? createBuffer();
573    WebGLFramebuffer? createFramebuffer();
574    WebGLProgram? createProgram();
575    WebGLRenderbuffer? createRenderbuffer();
576    WebGLShader? createShader(GLenum type);
577    WebGLTexture? createTexture();
578
579    void cullFace(GLenum mode);
580
581    void deleteBuffer(WebGLBuffer? buffer);
582    void deleteFramebuffer(WebGLFramebuffer? framebuffer);
583    void deleteProgram(WebGLProgram? program);
584    void deleteRenderbuffer(WebGLRenderbuffer? renderbuffer);
585    void deleteShader(WebGLShader? shader);
586    void deleteTexture(WebGLTexture? texture);
587
588    void depthFunc(GLenum func);
589    void depthMask(GLboolean flag);
590    void depthRange(GLclampf zNear, GLclampf zFar);
591    void detachShader(WebGLProgram program, WebGLShader shader);
592    void disable(GLenum cap);
593    void disableVertexAttribArray(GLuint index);
594    void drawArrays(GLenum mode, GLint first, GLsizei count);
595    void drawElements(GLenum mode, GLsizei count, GLenum type, GLintptr offset);
596
597    void enable(GLenum cap);
598    void enableVertexAttribArray(GLuint index);
599    void finish();
600    void flush();
601    void framebufferRenderbuffer(GLenum target, GLenum attachment,
602                                 GLenum renderbuffertarget,
603                                 WebGLRenderbuffer? renderbuffer);
604    void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget,
605                              WebGLTexture? texture, GLint level);
606    void frontFace(GLenum mode);
607
608    void generateMipmap(GLenum target);
609
610    [NewObject]
611    WebGLActiveInfo? getActiveAttrib(WebGLProgram program, GLuint index);
612    [NewObject]
613    WebGLActiveInfo? getActiveUniform(WebGLProgram program, GLuint index);
614
615    sequence<WebGLShader>? getAttachedShaders(WebGLProgram program);
616
617    [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram program, DOMString name);
618
619    any getBufferParameter(GLenum target, GLenum pname);
620    [Throws]
621    any getParameter(GLenum pname);
622
623    [WebGLHandlesContextLoss] GLenum getError();
624
625    [Throws]
626    any getFramebufferAttachmentParameter(GLenum target, GLenum attachment,
627                                          GLenum pname);
628    any getProgramParameter(WebGLProgram program, GLenum pname);
629    DOMString? getProgramInfoLog(WebGLProgram program);
630    any getRenderbufferParameter(GLenum target, GLenum pname);
631    any getShaderParameter(WebGLShader shader, GLenum pname);
632
633    [NewObject]
634    WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
635
636    DOMString? getShaderInfoLog(WebGLShader shader);
637
638    DOMString? getShaderSource(WebGLShader shader);
639
640    any getTexParameter(GLenum target, GLenum pname);
641
642    any getUniform(WebGLProgram program, WebGLUniformLocation location);
643
644    [NewObject]
645    WebGLUniformLocation? getUniformLocation(WebGLProgram program, DOMString name);
646
647    [Throws]
648    any getVertexAttrib(GLuint index, GLenum pname);
649
650    [WebGLHandlesContextLoss] GLintptr getVertexAttribOffset(GLuint index, GLenum pname);
651
652    void hint(GLenum target, GLenum mode);
653    [WebGLHandlesContextLoss] GLboolean isBuffer(WebGLBuffer? buffer);
654    [WebGLHandlesContextLoss] GLboolean isEnabled(GLenum cap);
655    [WebGLHandlesContextLoss] GLboolean isFramebuffer(WebGLFramebuffer? framebuffer);
656    [WebGLHandlesContextLoss] GLboolean isProgram(WebGLProgram? program);
657    [WebGLHandlesContextLoss] GLboolean isRenderbuffer(WebGLRenderbuffer? renderbuffer);
658    [WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader);
659    [WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture);
660    void lineWidth(GLfloat width);
661    void linkProgram(WebGLProgram program);
662    void pixelStorei(GLenum pname, GLint param);
663    void polygonOffset(GLfloat factor, GLfloat units);
664
665    void renderbufferStorage(GLenum target, GLenum internalformat,
666                             GLsizei width, GLsizei height);
667    void sampleCoverage(GLclampf value, GLboolean invert);
668    void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
669
670    void shaderSource(WebGLShader shader, DOMString source);
671
672    void stencilFunc(GLenum func, GLint ref, GLuint mask);
673    void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
674    void stencilMask(GLuint mask);
675    void stencilMaskSeparate(GLenum face, GLuint mask);
676    void stencilOp(GLenum fail, GLenum zfail, GLenum zpass);
677    void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
678
679    void texParameterf(GLenum target, GLenum pname, GLfloat param);
680    void texParameteri(GLenum target, GLenum pname, GLint param);
681
682    void uniform1f(WebGLUniformLocation? location, GLfloat x);
683    void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
684    void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z);
685    void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
686
687    void uniform1i(WebGLUniformLocation? location, GLint x);
688    void uniform2i(WebGLUniformLocation? location, GLint x, GLint y);
689    void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
690    void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
691
692    void useProgram(WebGLProgram? program);
693    void validateProgram(WebGLProgram program);
694
695    void vertexAttrib1f(GLuint indx, GLfloat x);
696    void vertexAttrib1fv(GLuint indx, Float32List values);
697    void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
698    void vertexAttrib2fv(GLuint indx, Float32List values);
699    void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
700    void vertexAttrib3fv(GLuint indx, Float32List values);
701    void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
702    void vertexAttrib4fv(GLuint indx, Float32List values);
703    void vertexAttribPointer(GLuint indx, GLint size, GLenum type,
704                             GLboolean normalized, GLsizei stride, GLintptr offset);
705
706    void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
707};
708
709[Exposed=(Window,Worker),
710 Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
711interface WebGLRenderingContext {
712    // bufferData has WebGL2 overloads.
713    void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
714    void bufferData(GLenum target, ArrayBuffer? data, GLenum usage);
715    void bufferData(GLenum target, ArrayBufferView data, GLenum usage);
716    // bufferSubData has WebGL2 overloads.
717    void bufferSubData(GLenum target, GLintptr offset, ArrayBuffer data);
718    void bufferSubData(GLenum target, GLintptr offset, ArrayBufferView data);
719
720    // compressedTexImage2D has WebGL2 overloads.
721    void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
722                              GLsizei width, GLsizei height, GLint border,
723                              ArrayBufferView data);
724    // compressedTexSubImage2D has WebGL2 overloads.
725    void compressedTexSubImage2D(GLenum target, GLint level,
726                                 GLint xoffset, GLint yoffset,
727                                 GLsizei width, GLsizei height, GLenum format,
728                                 ArrayBufferView data);
729
730    // readPixels has WebGL2 overloads.
731    [Throws]
732    void readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
733                    GLenum format, GLenum type, ArrayBufferView? pixels);
734
735    // texImage2D has WebGL2 overloads.
736    // Overloads must share [Throws].
737    [Throws] // Can't actually throw.
738    void texImage2D(GLenum target, GLint level, GLint internalformat,
739                    GLsizei width, GLsizei height, GLint border, GLenum format,
740                    GLenum type, ArrayBufferView? pixels);
741    [Throws] // Can't actually throw.
742    void texImage2D(GLenum target, GLint level, GLint internalformat,
743                    GLenum format, GLenum type, ImageBitmap pixels);
744    [Throws] // Can't actually throw.
745    void texImage2D(GLenum target, GLint level, GLint internalformat,
746                    GLenum format, GLenum type, ImageData pixels);
747    [Throws]
748    void texImage2D(GLenum target, GLint level, GLint internalformat,
749                    GLenum format, GLenum type, HTMLImageElement image); // May throw DOMException
750    [Throws]
751    void texImage2D(GLenum target, GLint level, GLint internalformat,
752                    GLenum format, GLenum type, HTMLCanvasElement canvas); // May throw DOMException
753    [Throws]
754    void texImage2D(GLenum target, GLint level, GLint internalformat,
755                    GLenum format, GLenum type, HTMLVideoElement video); // May throw DOMException
756
757    // texSubImage2D has WebGL2 overloads.
758    [Throws] // Can't actually throw.
759    void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
760                       GLsizei width, GLsizei height,
761                       GLenum format, GLenum type, ArrayBufferView? pixels);
762    [Throws] // Can't actually throw.
763    void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
764                       GLenum format, GLenum type, ImageBitmap pixels);
765    [Throws] // Can't actually throw.
766    void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
767                       GLenum format, GLenum type, ImageData pixels);
768    [Throws]
769    void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
770                       GLenum format, GLenum type, HTMLImageElement image); // May throw DOMException
771    [Throws]
772    void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
773                       GLenum format, GLenum type, HTMLCanvasElement canvas); // May throw DOMException
774    [Throws]
775    void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
776                       GLenum format, GLenum type, HTMLVideoElement video); // May throw DOMException
777
778    // uniform*fv have WebGL2 overloads, or rather extensions, that are not
779    // distinguishable from the WebGL1 versions when called with two arguments.
780    void uniform1fv(WebGLUniformLocation? location, Float32List data);
781    void uniform2fv(WebGLUniformLocation? location, Float32List data);
782    void uniform3fv(WebGLUniformLocation? location, Float32List data);
783    void uniform4fv(WebGLUniformLocation? location, Float32List data);
784
785    // uniform*iv have WebGL2 overloads, or rather extensions, that are not
786    // distinguishable from the WebGL1 versions when called with two arguments.
787    void uniform1iv(WebGLUniformLocation? location, Int32List data);
788    void uniform2iv(WebGLUniformLocation? location, Int32List data);
789    void uniform3iv(WebGLUniformLocation? location, Int32List data);
790    void uniform4iv(WebGLUniformLocation? location, Int32List data);
791
792    // uniformMatrix*fv have WebGL2 overloads, or rather extensions, that are
793    // not distinguishable from the WebGL1 versions when called with two
794    // arguments.
795    void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data);
796    void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data);
797    void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data);
798};
799
800WebGLRenderingContext implements WebGLRenderingContextBase;
801
802// For OffscreenCanvas
803// Reference: https://wiki.whatwg.org/wiki/OffscreenCanvas
804[Exposed=(Window,Worker)]
805partial interface WebGLRenderingContext {
806    [Func="mozilla::dom::OffscreenCanvas::PrefEnabled"]
807    void commit();
808};
809
810////////////////////////////////////////
811// specific extension interfaces
812
813[NoInterfaceObject]
814interface WEBGL_compressed_texture_s3tc
815{
816    const GLenum COMPRESSED_RGB_S3TC_DXT1_EXT  = 0x83F0;
817    const GLenum COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
818    const GLenum COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
819    const GLenum COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
820};
821
822[NoInterfaceObject]
823interface WEBGL_compressed_texture_atc
824{
825    const GLenum COMPRESSED_RGB_ATC_WEBGL                     = 0x8C92;
826    const GLenum COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL     = 0x8C93;
827    const GLenum COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL = 0x87EE;
828};
829
830[NoInterfaceObject]
831interface WEBGL_compressed_texture_etc
832{
833    const GLenum COMPRESSED_R11_EAC                                 = 0x9270;
834    const GLenum COMPRESSED_SIGNED_R11_EAC                          = 0x9271;
835    const GLenum COMPRESSED_RG11_EAC                                = 0x9272;
836    const GLenum COMPRESSED_SIGNED_RG11_EAC                         = 0x9273;
837    const GLenum COMPRESSED_RGB8_ETC2                               = 0x9274;
838    const GLenum COMPRESSED_SRGB8_ETC2                              = 0x9275;
839    const GLenum COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2           = 0x9276;
840    const GLenum COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2          = 0x9277;
841    const GLenum COMPRESSED_RGBA8_ETC2_EAC                          = 0x9278;
842    const GLenum COMPRESSED_SRGB8_ALPHA8_ETC2_EAC                   = 0x9279;
843};
844
845[NoInterfaceObject]
846interface WEBGL_compressed_texture_etc1
847{
848    const GLenum COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
849};
850
851[NoInterfaceObject]
852interface WEBGL_compressed_texture_pvrtc
853{
854    const GLenum COMPRESSED_RGB_PVRTC_4BPPV1_IMG  = 0x8C00;
855    const GLenum COMPRESSED_RGB_PVRTC_2BPPV1_IMG  = 0x8C01;
856    const GLenum COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
857    const GLenum COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
858};
859
860[NoInterfaceObject]
861interface WEBGL_debug_renderer_info
862{
863    const GLenum UNMASKED_VENDOR_WEBGL        = 0x9245;
864    const GLenum UNMASKED_RENDERER_WEBGL      = 0x9246;
865};
866
867[NoInterfaceObject]
868interface WEBGL_debug_shaders
869{
870    DOMString getTranslatedShaderSource(WebGLShader shader);
871};
872
873[NoInterfaceObject]
874interface WEBGL_depth_texture
875{
876    const GLenum UNSIGNED_INT_24_8_WEBGL = 0x84FA;
877};
878
879[NoInterfaceObject]
880interface OES_element_index_uint
881{
882};
883
884[NoInterfaceObject]
885interface EXT_frag_depth
886{
887};
888
889[NoInterfaceObject]
890interface WEBGL_lose_context {
891    void loseContext();
892    void restoreContext();
893};
894
895[NoInterfaceObject]
896interface EXT_texture_filter_anisotropic
897{
898    const GLenum TEXTURE_MAX_ANISOTROPY_EXT     = 0x84FE;
899    const GLenum MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
900};
901
902[NoInterfaceObject]
903interface EXT_sRGB
904{
905    const GLenum SRGB_EXT                                  = 0x8C40;
906    const GLenum SRGB_ALPHA_EXT                            = 0x8C42;
907    const GLenum SRGB8_ALPHA8_EXT                          = 0x8C43;
908    const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210;
909};
910
911[NoInterfaceObject]
912interface OES_standard_derivatives {
913    const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
914};
915
916[NoInterfaceObject]
917interface OES_texture_float
918{
919};
920
921[NoInterfaceObject]
922interface WEBGL_draw_buffers {
923    const GLenum COLOR_ATTACHMENT0_WEBGL     = 0x8CE0;
924    const GLenum COLOR_ATTACHMENT1_WEBGL     = 0x8CE1;
925    const GLenum COLOR_ATTACHMENT2_WEBGL     = 0x8CE2;
926    const GLenum COLOR_ATTACHMENT3_WEBGL     = 0x8CE3;
927    const GLenum COLOR_ATTACHMENT4_WEBGL     = 0x8CE4;
928    const GLenum COLOR_ATTACHMENT5_WEBGL     = 0x8CE5;
929    const GLenum COLOR_ATTACHMENT6_WEBGL     = 0x8CE6;
930    const GLenum COLOR_ATTACHMENT7_WEBGL     = 0x8CE7;
931    const GLenum COLOR_ATTACHMENT8_WEBGL     = 0x8CE8;
932    const GLenum COLOR_ATTACHMENT9_WEBGL     = 0x8CE9;
933    const GLenum COLOR_ATTACHMENT10_WEBGL    = 0x8CEA;
934    const GLenum COLOR_ATTACHMENT11_WEBGL    = 0x8CEB;
935    const GLenum COLOR_ATTACHMENT12_WEBGL    = 0x8CEC;
936    const GLenum COLOR_ATTACHMENT13_WEBGL    = 0x8CED;
937    const GLenum COLOR_ATTACHMENT14_WEBGL    = 0x8CEE;
938    const GLenum COLOR_ATTACHMENT15_WEBGL    = 0x8CEF;
939
940    const GLenum DRAW_BUFFER0_WEBGL          = 0x8825;
941    const GLenum DRAW_BUFFER1_WEBGL          = 0x8826;
942    const GLenum DRAW_BUFFER2_WEBGL          = 0x8827;
943    const GLenum DRAW_BUFFER3_WEBGL          = 0x8828;
944    const GLenum DRAW_BUFFER4_WEBGL          = 0x8829;
945    const GLenum DRAW_BUFFER5_WEBGL          = 0x882A;
946    const GLenum DRAW_BUFFER6_WEBGL          = 0x882B;
947    const GLenum DRAW_BUFFER7_WEBGL          = 0x882C;
948    const GLenum DRAW_BUFFER8_WEBGL          = 0x882D;
949    const GLenum DRAW_BUFFER9_WEBGL          = 0x882E;
950    const GLenum DRAW_BUFFER10_WEBGL         = 0x882F;
951    const GLenum DRAW_BUFFER11_WEBGL         = 0x8830;
952    const GLenum DRAW_BUFFER12_WEBGL         = 0x8831;
953    const GLenum DRAW_BUFFER13_WEBGL         = 0x8832;
954    const GLenum DRAW_BUFFER14_WEBGL         = 0x8833;
955    const GLenum DRAW_BUFFER15_WEBGL         = 0x8834;
956
957    const GLenum MAX_COLOR_ATTACHMENTS_WEBGL = 0x8CDF;
958    const GLenum MAX_DRAW_BUFFERS_WEBGL      = 0x8824;
959
960    void drawBuffersWEBGL(sequence<GLenum> buffers);
961};
962
963[NoInterfaceObject]
964interface OES_texture_float_linear
965{
966};
967
968[NoInterfaceObject]
969interface EXT_shader_texture_lod
970{
971};
972
973[NoInterfaceObject]
974interface OES_texture_half_float
975{
976    const GLenum HALF_FLOAT_OES = 0x8D61;
977};
978
979[NoInterfaceObject]
980interface OES_texture_half_float_linear
981{
982};
983
984[NoInterfaceObject]
985interface WEBGL_color_buffer_float
986{
987    const GLenum RGBA32F_EXT = 0x8814;
988    const GLenum RGB32F_EXT = 0x8815;
989    const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211;
990    const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17;
991};
992
993[NoInterfaceObject]
994interface EXT_color_buffer_half_float
995{
996    const GLenum RGBA16F_EXT = 0x881A;
997    const GLenum RGB16F_EXT = 0x881B;
998    const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211;
999    const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17;
1000};
1001
1002[NoInterfaceObject]
1003interface OES_vertex_array_object {
1004    const GLenum VERTEX_ARRAY_BINDING_OES = 0x85B5;
1005
1006    WebGLVertexArrayObject? createVertexArrayOES();
1007    void deleteVertexArrayOES(WebGLVertexArrayObject? arrayObject);
1008    [WebGLHandlesContextLoss] GLboolean isVertexArrayOES(WebGLVertexArrayObject? arrayObject);
1009    void bindVertexArrayOES(WebGLVertexArrayObject? arrayObject);
1010};
1011
1012[NoInterfaceObject]
1013interface ANGLE_instanced_arrays {
1014    const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
1015
1016    void drawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
1017    void drawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei primcount);
1018    void vertexAttribDivisorANGLE(GLuint index, GLuint divisor);
1019};
1020
1021[NoInterfaceObject]
1022interface EXT_blend_minmax {
1023    const GLenum MIN_EXT = 0x8007;
1024    const GLenum MAX_EXT = 0x8008;
1025};
1026
1027interface WebGLQuery {
1028};
1029
1030[NoInterfaceObject]
1031interface EXT_disjoint_timer_query {
1032    const GLenum QUERY_COUNTER_BITS_EXT = 0x8864;
1033    const GLenum CURRENT_QUERY_EXT = 0x8865;
1034    const GLenum QUERY_RESULT_EXT = 0x8866;
1035    const GLenum QUERY_RESULT_AVAILABLE_EXT = 0x8867;
1036    const GLenum TIME_ELAPSED_EXT = 0x88BF;
1037    const GLenum TIMESTAMP_EXT = 0x8E28;
1038    const GLenum GPU_DISJOINT_EXT = 0x8FBB;
1039
1040    WebGLQuery? createQueryEXT();
1041    void deleteQueryEXT(WebGLQuery? query);
1042    [WebGLHandlesContextLoss] boolean isQueryEXT(WebGLQuery? query);
1043    void beginQueryEXT(GLenum target, WebGLQuery query);
1044    void endQueryEXT(GLenum target);
1045    void queryCounterEXT(WebGLQuery query, GLenum target);
1046    any getQueryEXT(GLenum target, GLenum pname);
1047    any getQueryObjectEXT(WebGLQuery query, GLenum pname);
1048};
1049