15c2f4ed506a19f99401c4acecd7b45f35ce13af
[WebKit-https.git] / Source / WebCore / html / canvas / WebGL2RenderingContext.idl
1 /*
2  * Copyright (C) 2015 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 typedef unsigned long      GLenum;
27 typedef boolean            GLboolean;
28 typedef unsigned long      GLbitfield;
29 typedef byte               GLbyte;
30 typedef short              GLshort;
31 typedef long               GLint;
32 typedef long               GLsizei;
33 typedef long long          GLintptr;
34 typedef long long          GLsizeiptr;
35 typedef long long          GLint64;
36 typedef octet              GLubyte;
37 typedef unsigned short     GLushort;
38 typedef unsigned long      GLuint;
39 typedef unsigned long long GLuint64;
40 typedef unrestricted float GLfloat;
41 typedef unrestricted float GLclampf;
42 typedef (ArrayBuffer or ArrayBufferView) BufferDataSource;
43
44 // FIXME: Should allow ImageBitmap too.
45 typedef (ImageData or HTMLImageElement or HTMLCanvasElement or HTMLVideoElement) TexImageSource;
46
47 [
48     Conditional=WEBGL2,
49     EnabledAtRuntime=WebGL2,
50     JSCustomMarkFunction,
51     JSGenerateToJSObject,
52     DoNotCheckConstants,
53 ] interface WebGL2RenderingContext : WebGLRenderingContextBase {
54     const GLenum READ_BUFFER                                   = 0x0C02;
55     const GLenum UNPACK_ROW_LENGTH                             = 0x0CF2;
56     const GLenum UNPACK_SKIP_ROWS                              = 0x0CF3;
57     const GLenum UNPACK_SKIP_PIXELS                            = 0x0CF4;
58     const GLenum PACK_ROW_LENGTH                               = 0x0D02;
59     const GLenum PACK_SKIP_ROWS                                = 0x0D03;
60     const GLenum PACK_SKIP_PIXELS                              = 0x0D04;
61     const GLenum COLOR                                         = 0x1800;
62     const GLenum DEPTH                                         = 0x1801;
63     const GLenum STENCIL                                       = 0x1802;
64     const GLenum RED                                           = 0x1903;
65     const GLenum RGB8                                          = 0x8051;
66     const GLenum RGBA8                                         = 0x8058;
67     const GLenum RGB10_A2                                      = 0x8059;
68     const GLenum TEXTURE_BINDING_3D                            = 0x806A;
69     const GLenum UNPACK_SKIP_IMAGES                            = 0x806D;
70     const GLenum UNPACK_IMAGE_HEIGHT                           = 0x806E;
71     const GLenum TEXTURE_3D                                    = 0x806F;
72     const GLenum TEXTURE_WRAP_R                                = 0x8072;
73     const GLenum MAX_3D_TEXTURE_SIZE                           = 0x8073;
74     const GLenum UNSIGNED_INT_2_10_10_10_REV                   = 0x8368;
75     const GLenum MAX_ELEMENTS_VERTICES                         = 0x80E8;
76     const GLenum MAX_ELEMENTS_INDICES                          = 0x80E9;
77     const GLenum TEXTURE_MIN_LOD                               = 0x813A;
78     const GLenum TEXTURE_MAX_LOD                               = 0x813B;
79     const GLenum TEXTURE_BASE_LEVEL                            = 0x813C;
80     const GLenum TEXTURE_MAX_LEVEL                             = 0x813D;
81     const GLenum MIN                                           = 0x8007;
82     const GLenum MAX                                           = 0x8008;
83     const GLenum DEPTH_COMPONENT24                             = 0x81A6;
84     const GLenum MAX_TEXTURE_LOD_BIAS                          = 0x84FD;
85     const GLenum TEXTURE_COMPARE_MODE                          = 0x884C;
86     const GLenum TEXTURE_COMPARE_FUNC                          = 0x884D;
87     const GLenum CURRENT_QUERY                                 = 0x8865;
88     const GLenum QUERY_RESULT                                  = 0x8866;
89     const GLenum QUERY_RESULT_AVAILABLE                        = 0x8867;
90     const GLenum STREAM_READ                                   = 0x88E1;
91     const GLenum STREAM_COPY                                   = 0x88E2;
92     const GLenum STATIC_READ                                   = 0x88E5;
93     const GLenum STATIC_COPY                                   = 0x88E6;
94     const GLenum DYNAMIC_READ                                  = 0x88E9;
95     const GLenum DYNAMIC_COPY                                  = 0x88EA;
96     const GLenum MAX_DRAW_BUFFERS                              = 0x8824;
97     const GLenum DRAW_BUFFER0                                  = 0x8825;
98     const GLenum DRAW_BUFFER1                                  = 0x8826;
99     const GLenum DRAW_BUFFER2                                  = 0x8827;
100     const GLenum DRAW_BUFFER3                                  = 0x8828;
101     const GLenum DRAW_BUFFER4                                  = 0x8829;
102     const GLenum DRAW_BUFFER5                                  = 0x882A;
103     const GLenum DRAW_BUFFER6                                  = 0x882B;
104     const GLenum DRAW_BUFFER7                                  = 0x882C;
105     const GLenum DRAW_BUFFER8                                  = 0x882D;
106     const GLenum DRAW_BUFFER9                                  = 0x882E;
107     const GLenum DRAW_BUFFER10                                 = 0x882F;
108     const GLenum DRAW_BUFFER11                                 = 0x8830;
109     const GLenum DRAW_BUFFER12                                 = 0x8831;
110     const GLenum DRAW_BUFFER13                                 = 0x8832;
111     const GLenum DRAW_BUFFER14                                 = 0x8833;
112     const GLenum DRAW_BUFFER15                                 = 0x8834;
113     const GLenum MAX_FRAGMENT_UNIFORM_COMPONENTS               = 0x8B49;
114     const GLenum MAX_VERTEX_UNIFORM_COMPONENTS                 = 0x8B4A;
115     const GLenum SAMPLER_3D                                    = 0x8B5F;
116     const GLenum SAMPLER_2D_SHADOW                             = 0x8B62;
117     const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT               = 0x8B8B;
118     const GLenum PIXEL_PACK_BUFFER                             = 0x88EB;
119     const GLenum PIXEL_UNPACK_BUFFER                           = 0x88EC;
120     const GLenum PIXEL_PACK_BUFFER_BINDING                     = 0x88ED;
121     const GLenum PIXEL_UNPACK_BUFFER_BINDING                   = 0x88EF;
122     const GLenum FLOAT_MAT2x3                                  = 0x8B65;
123     const GLenum FLOAT_MAT2x4                                  = 0x8B66;
124     const GLenum FLOAT_MAT3x2                                  = 0x8B67;
125     const GLenum FLOAT_MAT3x4                                  = 0x8B68;
126     const GLenum FLOAT_MAT4x2                                  = 0x8B69;
127     const GLenum FLOAT_MAT4x3                                  = 0x8B6A;
128     const GLenum SRGB                                          = 0x8C40;
129     const GLenum SRGB8                                         = 0x8C41;
130     const GLenum SRGB8_ALPHA8                                  = 0x8C43;
131     const GLenum COMPARE_REF_TO_TEXTURE                        = 0x884E;
132     const GLenum RGBA32F                                       = 0x8814;
133     const GLenum RGB32F                                        = 0x8815;
134     const GLenum RGBA16F                                       = 0x881A;
135     const GLenum RGB16F                                        = 0x881B;
136     const GLenum VERTEX_ATTRIB_ARRAY_INTEGER                   = 0x88FD;
137     const GLenum MAX_ARRAY_TEXTURE_LAYERS                      = 0x88FF;
138     const GLenum MIN_PROGRAM_TEXEL_OFFSET                      = 0x8904;
139     const GLenum MAX_PROGRAM_TEXEL_OFFSET                      = 0x8905;
140     const GLenum MAX_VARYING_COMPONENTS                        = 0x8B4B;
141     const GLenum TEXTURE_2D_ARRAY                              = 0x8C1A;
142     const GLenum TEXTURE_BINDING_2D_ARRAY                      = 0x8C1D;
143     const GLenum R11F_G11F_B10F                                = 0x8C3A;
144     const GLenum UNSIGNED_INT_10F_11F_11F_REV                  = 0x8C3B;
145     const GLenum RGB9_E5                                       = 0x8C3D;
146     const GLenum UNSIGNED_INT_5_9_9_9_REV                      = 0x8C3E;
147     const GLenum TRANSFORM_FEEDBACK_BUFFER_MODE                = 0x8C7F;
148     const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS    = 0x8C80;
149     const GLenum TRANSFORM_FEEDBACK_VARYINGS                   = 0x8C83;
150     const GLenum TRANSFORM_FEEDBACK_BUFFER_START               = 0x8C84;
151     const GLenum TRANSFORM_FEEDBACK_BUFFER_SIZE                = 0x8C85;
152     const GLenum TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN         = 0x8C88;
153     const GLenum RASTERIZER_DISCARD                            = 0x8C89;
154     const GLenum MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
155     const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS       = 0x8C8B;
156     const GLenum INTERLEAVED_ATTRIBS                           = 0x8C8C;
157     const GLenum SEPARATE_ATTRIBS                              = 0x8C8D;
158     const GLenum TRANSFORM_FEEDBACK_BUFFER                     = 0x8C8E;
159     const GLenum TRANSFORM_FEEDBACK_BUFFER_BINDING             = 0x8C8F;
160     const GLenum RGBA32UI                                      = 0x8D70;
161     const GLenum RGB32UI                                       = 0x8D71;
162     const GLenum RGBA16UI                                      = 0x8D76;
163     const GLenum RGB16UI                                       = 0x8D77;
164     const GLenum RGBA8UI                                       = 0x8D7C;
165     const GLenum RGB8UI                                        = 0x8D7D;
166     const GLenum RGBA32I                                       = 0x8D82;
167     const GLenum RGB32I                                        = 0x8D83;
168     const GLenum RGBA16I                                       = 0x8D88;
169     const GLenum RGB16I                                        = 0x8D89;
170     const GLenum RGBA8I                                        = 0x8D8E;
171     const GLenum RGB8I                                         = 0x8D8F;
172     const GLenum RED_INTEGER                                   = 0x8D94;
173     const GLenum RGB_INTEGER                                   = 0x8D98;
174     const GLenum RGBA_INTEGER                                  = 0x8D99;
175     const GLenum SAMPLER_2D_ARRAY                              = 0x8DC1;
176     const GLenum SAMPLER_2D_ARRAY_SHADOW                       = 0x8DC4;
177     const GLenum SAMPLER_CUBE_SHADOW                           = 0x8DC5;
178     const GLenum UNSIGNED_INT_VEC2                             = 0x8DC6;
179     const GLenum UNSIGNED_INT_VEC3                             = 0x8DC7;
180     const GLenum UNSIGNED_INT_VEC4                             = 0x8DC8;
181     const GLenum INT_SAMPLER_2D                                = 0x8DCA;
182     const GLenum INT_SAMPLER_3D                                = 0x8DCB;
183     const GLenum INT_SAMPLER_CUBE                              = 0x8DCC;
184     const GLenum INT_SAMPLER_2D_ARRAY                          = 0x8DCF;
185     const GLenum UNSIGNED_INT_SAMPLER_2D                       = 0x8DD2;
186     const GLenum UNSIGNED_INT_SAMPLER_3D                       = 0x8DD3;
187     const GLenum UNSIGNED_INT_SAMPLER_CUBE                     = 0x8DD4;
188     const GLenum UNSIGNED_INT_SAMPLER_2D_ARRAY                 = 0x8DD7;
189     const GLenum DEPTH_COMPONENT32F                            = 0x8CAC;
190     const GLenum DEPTH32F_STENCIL8                             = 0x8CAD;
191     const GLenum FLOAT_32_UNSIGNED_INT_24_8_REV                = 0x8DAD;
192     const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING         = 0x8210;
193     const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE         = 0x8211;
194     const GLenum FRAMEBUFFER_ATTACHMENT_RED_SIZE               = 0x8212;
195     const GLenum FRAMEBUFFER_ATTACHMENT_GREEN_SIZE             = 0x8213;
196     const GLenum FRAMEBUFFER_ATTACHMENT_BLUE_SIZE              = 0x8214;
197     const GLenum FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE             = 0x8215;
198     const GLenum FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE             = 0x8216;
199     const GLenum FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE           = 0x8217;
200     const GLenum FRAMEBUFFER_DEFAULT                           = 0x8218;
201     const GLenum DEPTH_STENCIL_ATTACHMENT                      = 0x821A;
202     const GLenum DEPTH_STENCIL                                 = 0x84F9;
203     const GLenum UNSIGNED_INT_24_8                             = 0x84FA;
204     const GLenum DEPTH24_STENCIL8                              = 0x88F0;
205     const GLenum UNSIGNED_NORMALIZED                           = 0x8C17;
206     const GLenum DRAW_FRAMEBUFFER_BINDING                      = 0x8CA6; /* Same as FRAMEBUFFER_BINDING */
207     const GLenum READ_FRAMEBUFFER                              = 0x8CA8;
208     const GLenum DRAW_FRAMEBUFFER                              = 0x8CA9;
209     const GLenum READ_FRAMEBUFFER_BINDING                      = 0x8CAA;
210     const GLenum RENDERBUFFER_SAMPLES                          = 0x8CAB;
211     const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER          = 0x8CD4;
212     const GLenum MAX_COLOR_ATTACHMENTS                         = 0x8CDF;
213     const GLenum COLOR_ATTACHMENT1                             = 0x8CE1;
214     const GLenum COLOR_ATTACHMENT2                             = 0x8CE2;
215     const GLenum COLOR_ATTACHMENT3                             = 0x8CE3;
216     const GLenum COLOR_ATTACHMENT4                             = 0x8CE4;
217     const GLenum COLOR_ATTACHMENT5                             = 0x8CE5;
218     const GLenum COLOR_ATTACHMENT6                             = 0x8CE6;
219     const GLenum COLOR_ATTACHMENT7                             = 0x8CE7;
220     const GLenum COLOR_ATTACHMENT8                             = 0x8CE8;
221     const GLenum COLOR_ATTACHMENT9                             = 0x8CE9;
222     const GLenum COLOR_ATTACHMENT10                            = 0x8CEA;
223     const GLenum COLOR_ATTACHMENT11                            = 0x8CEB;
224     const GLenum COLOR_ATTACHMENT12                            = 0x8CEC;
225     const GLenum COLOR_ATTACHMENT13                            = 0x8CED;
226     const GLenum COLOR_ATTACHMENT14                            = 0x8CEE;
227     const GLenum COLOR_ATTACHMENT15                            = 0x8CEF;
228     const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE            = 0x8D56;
229     const GLenum MAX_SAMPLES                                   = 0x8D57;
230     const GLenum HALF_FLOAT                                    = 0x140B;
231     const GLenum RG                                            = 0x8227;
232     const GLenum RG_INTEGER                                    = 0x8228;
233     const GLenum R8                                            = 0x8229;
234     const GLenum RG8                                           = 0x822B;
235     const GLenum R16F                                          = 0x822D;
236     const GLenum R32F                                          = 0x822E;
237     const GLenum RG16F                                         = 0x822F;
238     const GLenum RG32F                                         = 0x8230;
239     const GLenum R8I                                           = 0x8231;
240     const GLenum R8UI                                          = 0x8232;
241     const GLenum R16I                                          = 0x8233;
242     const GLenum R16UI                                         = 0x8234;
243     const GLenum R32I                                          = 0x8235;
244     const GLenum R32UI                                         = 0x8236;
245     const GLenum RG8I                                          = 0x8237;
246     const GLenum RG8UI                                         = 0x8238;
247     const GLenum RG16I                                         = 0x8239;
248     const GLenum RG16UI                                        = 0x823A;
249     const GLenum RG32I                                         = 0x823B;
250     const GLenum RG32UI                                        = 0x823C;
251     const GLenum VERTEX_ARRAY_BINDING                          = 0x85B5;
252     const GLenum R8_SNORM                                      = 0x8F94;
253     const GLenum RG8_SNORM                                     = 0x8F95;
254     const GLenum RGB8_SNORM                                    = 0x8F96;
255     const GLenum RGBA8_SNORM                                   = 0x8F97;
256     const GLenum SIGNED_NORMALIZED                             = 0x8F9C;
257     const GLenum PRIMITIVE_RESTART_FIXED_INDEX                 = 0x8D69;
258     const GLenum COPY_READ_BUFFER                              = 0x8F36;
259     const GLenum COPY_WRITE_BUFFER                             = 0x8F37;
260     const GLenum COPY_READ_BUFFER_BINDING                      = 0x8F36; /* Same as COPY_READ_BUFFER */
261     const GLenum COPY_WRITE_BUFFER_BINDING                     = 0x8F37; /* Same as COPY_WRITE_BUFFER */
262     const GLenum UNIFORM_BUFFER                                = 0x8A11;
263     const GLenum UNIFORM_BUFFER_BINDING                        = 0x8A28;
264     const GLenum UNIFORM_BUFFER_START                          = 0x8A29;
265     const GLenum UNIFORM_BUFFER_SIZE                           = 0x8A2A;
266     const GLenum MAX_VERTEX_UNIFORM_BLOCKS                     = 0x8A2B;
267     const GLenum MAX_FRAGMENT_UNIFORM_BLOCKS                   = 0x8A2D;
268     const GLenum MAX_COMBINED_UNIFORM_BLOCKS                   = 0x8A2E;
269     const GLenum MAX_UNIFORM_BUFFER_BINDINGS                   = 0x8A2F;
270     const GLenum MAX_UNIFORM_BLOCK_SIZE                        = 0x8A30;
271     const GLenum MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS        = 0x8A31;
272     const GLenum MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS      = 0x8A33;
273     const GLenum UNIFORM_BUFFER_OFFSET_ALIGNMENT               = 0x8A34;
274     const GLenum ACTIVE_UNIFORM_BLOCKS                         = 0x8A36;
275     const GLenum UNIFORM_TYPE                                  = 0x8A37;
276     const GLenum UNIFORM_SIZE                                  = 0x8A38;
277     const GLenum UNIFORM_BLOCK_INDEX                           = 0x8A3A;
278     const GLenum UNIFORM_OFFSET                                = 0x8A3B;
279     const GLenum UNIFORM_ARRAY_STRIDE                          = 0x8A3C;
280     const GLenum UNIFORM_MATRIX_STRIDE                         = 0x8A3D;
281     const GLenum UNIFORM_IS_ROW_MAJOR                          = 0x8A3E;
282     const GLenum UNIFORM_BLOCK_BINDING                         = 0x8A3F;
283     const GLenum UNIFORM_BLOCK_DATA_SIZE                       = 0x8A40;
284     const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORMS                 = 0x8A42;
285     const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES          = 0x8A43;
286     const GLenum UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER     = 0x8A44;
287     const GLenum UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER   = 0x8A46;
288     const GLenum INVALID_INDEX                                 = 0xFFFFFFFF;
289     const GLenum MAX_VERTEX_OUTPUT_COMPONENTS                  = 0x9122;
290     const GLenum MAX_FRAGMENT_INPUT_COMPONENTS                 = 0x9125;
291     const GLenum MAX_SERVER_WAIT_TIMEOUT                       = 0x9111;
292     const GLenum OBJECT_TYPE                                   = 0x9112;
293     const GLenum SYNC_CONDITION                                = 0x9113;
294     const GLenum SYNC_STATUS                                   = 0x9114;
295     const GLenum SYNC_FLAGS                                    = 0x9115;
296     const GLenum SYNC_FENCE                                    = 0x9116;
297     const GLenum SYNC_GPU_COMMANDS_COMPLETE                    = 0x9117;
298     const GLenum UNSIGNALED                                    = 0x9118;
299     const GLenum SIGNALED                                      = 0x9119;
300     const GLenum ALREADY_SIGNALED                              = 0x911A;
301     const GLenum TIMEOUT_EXPIRED                               = 0x911B;
302     const GLenum CONDITION_SATISFIED                           = 0x911C;
303     const GLenum WAIT_FAILED                                   = 0x911D;
304     const GLenum SYNC_FLUSH_COMMANDS_BIT                       = 0x00000001;
305     const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR                   = 0x88FE;
306     const GLenum ANY_SAMPLES_PASSED                            = 0x8C2F;
307     const GLenum ANY_SAMPLES_PASSED_CONSERVATIVE               = 0x8D6A;
308     const GLenum SAMPLER_BINDING                               = 0x8919;
309     const GLenum RGB10_A2UI                                    = 0x906F;
310     const GLenum TEXTURE_SWIZZLE_R                             = 0x8E42;
311     const GLenum TEXTURE_SWIZZLE_G                             = 0x8E43;
312     const GLenum TEXTURE_SWIZZLE_B                             = 0x8E44;
313     const GLenum TEXTURE_SWIZZLE_A                             = 0x8E45;
314     const GLenum GREEN                                         = 0x1904;
315     const GLenum BLUE                                          = 0x1905;
316     const GLenum INT_2_10_10_10_REV                            = 0x8D9F;
317     const GLenum TRANSFORM_FEEDBACK                            = 0x8E22;
318     const GLenum TRANSFORM_FEEDBACK_PAUSED                     = 0x8E23;
319     const GLenum TRANSFORM_FEEDBACK_ACTIVE                     = 0x8E24;
320     const GLenum TRANSFORM_FEEDBACK_BINDING                    = 0x8E25;
321     const GLenum COMPRESSED_R11_EAC                            = 0x9270;
322     const GLenum COMPRESSED_SIGNED_R11_EAC                     = 0x9271;
323     const GLenum COMPRESSED_RG11_EAC                           = 0x9272;
324     const GLenum COMPRESSED_SIGNED_RG11_EAC                    = 0x9273;
325     const GLenum COMPRESSED_RGB8_ETC2                          = 0x9274;
326     const GLenum COMPRESSED_SRGB8_ETC2                         = 0x9275;
327     const GLenum COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2      = 0x9276;
328     const GLenum COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2     = 0x9277;
329     const GLenum COMPRESSED_RGBA8_ETC2_EAC                     = 0x9278;
330     const GLenum COMPRESSED_SRGB8_ALPHA8_ETC2_EAC              = 0x9279;
331     const GLenum TEXTURE_IMMUTABLE_FORMAT                      = 0x912F;
332     const GLenum MAX_ELEMENT_INDEX                             = 0x8D6B;
333     const GLenum NUM_SAMPLE_COUNTS                             = 0x9380;
334     const GLenum TEXTURE_IMMUTABLE_LEVELS                      = 0x82DF;
335     const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE             = 0x88FE;
336
337     const GLuint64 TIMEOUT_IGNORED                             = 0xFFFFFFFFFFFFFFFF;
338
339     /* Buffer objects */
340     // WebGL1:
341     void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
342     void bufferData(GLenum target, BufferDataSource? srcData, GLenum usage);
343     void bufferSubData(GLenum target, GLintptr dstByteOffset, BufferDataSource? srcData);
344     // WebGL2:
345     void bufferData(GLenum target, ArrayBufferView data, GLenum usage, GLuint srcOffset, optional GLuint length = 0);
346     void bufferSubData(GLenum target, GLintptr dstByteOffset, ArrayBufferView srcData, GLuint srcOffset, optional GLuint length = 0);
347
348     void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
349     // MapBufferRange, in particular its read-only and write-only modes,
350     // can not be exposed safely to JavaScript. GetBufferSubData
351     // replaces it for the purpose of fetching data back from the GPU.
352     void getBufferSubData(GLenum target, GLintptr srcByteOffset, ArrayBufferView dstData, optional GLuint dstOffset = 0, optional GLuint length = 0);
353
354     /* Framebuffer objects */
355     void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
356     void framebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
357     [OverrideIDLType=IDLWebGLAny] any getInternalformatParameter(GLenum target, GLenum internalformat, GLenum pname);
358     void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments);
359     void invalidateSubFramebuffer(GLenum target, sequence<GLenum> attachments, GLint x, GLint y, GLsizei width, GLsizei height);
360     void readBuffer(GLenum src);
361
362     /* Renderbuffer objects */
363     void renderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
364
365     /* Texture objects */
366     void texStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
367     void texStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
368     void texImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, ArrayBufferView? pixels);
369
370     void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, ArrayBufferView? pixels);
371     void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, TexImageSource source);
372
373     void copyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
374     void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, ArrayBufferView? data);
375     void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, ArrayBufferView? data);
376
377     /* Programs and shaders */
378     GLint getFragDataLocation(WebGLProgram? program, DOMString name);
379
380     /* Uniforms and attributes */
381     void uniform1ui(WebGLUniformLocation? location, GLuint v0);
382     void uniform2ui(WebGLUniformLocation? location, GLuint v0, GLuint v1);
383     void uniform3ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2);
384     void uniform4ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
385     void uniform1uiv(WebGLUniformLocation? location, Uint32Array? value);
386     void uniform2uiv(WebGLUniformLocation? location, Uint32Array? value);
387     void uniform3uiv(WebGLUniformLocation? location, Uint32Array? value);
388     void uniform4uiv(WebGLUniformLocation? location, Uint32Array? value);
389     void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array? value);
390     void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array? value);
391     void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array? value);
392     void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array? value);
393     void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array? value);
394     void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array? value);
395     void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
396     void vertexAttribI4iv(GLuint index, Int32Array? v);
397     void vertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
398     void vertexAttribI4uiv(GLuint index, Uint32Array? v);
399     void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
400
401     /* Writing to the drawing buffer */
402     void vertexAttribDivisor(GLuint index, GLuint divisor);
403     void drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount);
404     void drawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount);
405     void drawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLintptr offset);
406
407     /* Multiple Render Targets */
408     void drawBuffers(sequence<GLenum> buffers);
409     void clearBufferiv(GLenum buffer, GLint drawbuffer, Int32Array? value);
410     void clearBufferuiv(GLenum buffer, GLint drawbuffer, Uint32Array? value);
411     void clearBufferfv(GLenum buffer, GLint drawbuffer, Float32Array? value);
412     void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
413
414     /* Query Objects */
415     WebGLQuery createQuery();
416     void deleteQuery(WebGLQuery? query);
417     GLboolean isQuery(WebGLQuery? query);
418     void beginQuery(GLenum target, WebGLQuery? query);
419     void endQuery(GLenum target);
420     WebGLQuery getQuery(GLenum target, GLenum pname);
421     [OverrideIDLType=IDLWebGLAny] any getQueryParameter(WebGLQuery? query, GLenum pname);
422
423     /* Sampler Objects */
424     WebGLSampler createSampler();
425     void deleteSampler(WebGLSampler? sampler);
426     GLboolean isSampler(WebGLSampler? sampler);
427     void bindSampler(GLuint unit, WebGLSampler? sampler);
428     void samplerParameteri(WebGLSampler? sampler, GLenum pname, GLint param);
429     void samplerParameterf(WebGLSampler? sampler, GLenum pname, GLfloat param);
430     [OverrideIDLType=IDLWebGLAny] any getSamplerParameter(WebGLSampler? sampler, GLenum pname);
431
432     /* Sync objects */
433     WebGLSync fenceSync(GLenum condition, GLbitfield flags);
434     GLboolean isSync(WebGLSync? sync);
435     void deleteSync(WebGLSync? sync);
436     GLenum clientWaitSync(WebGLSync? sync, GLbitfield flags, GLuint64 timeout);
437     void waitSync(WebGLSync? sync, GLbitfield flags, GLuint64 timeout);
438     [OverrideIDLType=IDLWebGLAny] any getSyncParameter(WebGLSync? sync, GLenum pname);
439
440     /* Transform Feedback */
441     WebGLTransformFeedback createTransformFeedback();
442     void deleteTransformFeedback(WebGLTransformFeedback? id);
443     GLboolean isTransformFeedback(WebGLTransformFeedback? id);
444     void bindTransformFeedback(GLenum target, WebGLTransformFeedback? id);
445     void beginTransformFeedback(GLenum primitiveMode);
446     void endTransformFeedback();
447     void transformFeedbackVaryings(WebGLProgram? program, sequence<DOMString> varyings, GLenum bufferMode);
448     WebGLActiveInfo getTransformFeedbackVarying(WebGLProgram? program, GLuint index);
449     void pauseTransformFeedback();
450     void resumeTransformFeedback();
451
452     /* Uniform Buffer Objects and Transform Feedback Buffers */
453     void bindBufferBase(GLenum target, GLuint index, WebGLBuffer? buffer);
454     void bindBufferRange(GLenum target, GLuint index, WebGLBuffer? buffer, GLintptr offset, GLsizeiptr size);
455     [OverrideIDLType=IDLWebGLAny] any getIndexedParameter(GLenum target, GLuint index);
456     Uint32Array getUniformIndices(WebGLProgram? program, sequence<DOMString> uniformNames);
457     Int32Array getActiveUniforms(WebGLProgram? program, Uint32Array? uniformIndices, GLenum pname);
458     GLuint getUniformBlockIndex(WebGLProgram? program, DOMString uniformBlockName);
459     [OverrideIDLType=IDLWebGLAny] any getActiveUniformBlockParameter(WebGLProgram? program, GLuint uniformBlockIndex, GLenum pname);
460     [OverrideIDLType=IDLWebGLAny] any getActiveUniformBlockName(WebGLProgram? program, GLuint uniformBlockIndex);
461     void uniformBlockBinding(WebGLProgram? program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
462
463     /* Vertex Array Objects */
464     WebGLVertexArrayObject createVertexArray();
465     void deleteVertexArray(WebGLVertexArrayObject? vertexArray);
466     GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
467     void bindVertexArray(WebGLVertexArrayObject? vertexArray);
468 };