1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2 "http://www.w3.org/TR/html4/strict.dtd">
5 <meta http-equiv="content-type" content="text/html; charset=utf-8">
6 <title>WebGL 2 Specification</title>
7 <meta name="generator" content="BBEdit 9.1">
8 <link rel="stylesheet" type="text/css" href="../../../resources/Khronos-WD.css" />
9 <script src="../../../resources/jquery-1.3.2.min.js" type="text/javascript"></script>
10 <script src="../../../resources/generateTOC.js" type="text/javascript"></script>
12 <body onload="generateTOC(document.getElementById('toc'))">
16 <a href="http://khronos.org/">
17 <img alt=Khronos height=60 src="../../../resources/KhronosGroup-3D.png" width=220>
23 <a href="http://webgl.org/">
24 <img alt=WebGL height=72 src="../../../resources/WebGL-Logo.png" width=156>
30 <h1>WebGL 2 Specification</h1>
31 <h2 class="no-toc">Editor's Draft 30 July 2014</h2>
35 <a href="https://www.khronos.org/registry/webgl/specs/latest/2.0/">
36 https://www.khronos.org/registry/webgl/specs/latest/2.0/
39 <a href="https://www.khronos.org/registry/webgl/specs/latest/2.0/webgl2.idl">
40 <b>WebIDL:</b> https://www.khronos.org/registry/webgl/specs/latest/2.0/webgl2.idl
45 <a href="https://www.khronos.org/registry/webgl/specs/latest/2.0/">
46 https://www.khronos.org/registry/webgl/specs/latest/2.0/
49 <a href="https://www.khronos.org/registry/webgl/specs/latest/2.0/webgl2.idl">
50 <b>WebIDL:</b> https://www.khronos.org/registry/webgl/specs/latest/2.0/webgl2.idl
55 <a href="https://www.khronos.org/registry/webgl/specs/1.0.2/">
56 https://www.khronos.org/registry/webgl/specs/1.0.2/
59 <a href="https://www.khronos.org/registry/webgl/specs/1.0.2/webgl.idl">
60 <b>WebIDL:</b> https://www.khronos.org/registry/webgl/specs/1.0.2/webgl.idl
65 <a href="mailto:dino@apple.com">Dean Jackson</a>
66 <a href="http://www.apple.com/">(Apple Inc.)</a>
70 <span style="font-size: x-small; font-style: oblique">Copyright © 2014 Khronos Group</span>
74 <h2 class="no-toc">Abstract</h2>
76 This is Version 2.0 of the WebGL Specification.
79 This specification describes an additional rendering context and support
81 <a href="http://www.w3.org/TR/html5/the-canvas-element.html"
82 title="HTML 5 Canvas Element">
83 HTML 5 <span class="prop-name">canvas</span> element <a href="#refsCANVAS">[CANVAS]</a>.
85 This context allows rendering using an API that conforms closely to the OpenGL ES 3.0 API.
88 This document should be read as an extension to the <a href="https://www.khronos.org/registry/webgl/specs/1.0.2/">
89 WebGL 1.0 specification</a>. It will only describe the differences from 1.0.</a>
91 <h2 class="no-toc">Status of this document</h2>
95 This document is an editor's draft. Do not cite this document as other than work in
96 progress. Public discussion of this specification is welcome on the
97 (<a href="https://www.khronos.org/webgl/public-mailing-list/archives/">archived</a>) WebGL
98 mailing list <a href="mailto:public_webgl@khronos.org">public_webgl@khronos.org</a> (see
99 <a href="http://www.khronos.org/webgl/public-mailing-list/">instructions</a>).
103 <h2 class="no-toc">Table of contents</h2>
106 <h2>Introduction</h2>
109 WebGL™ is an immediate mode 3D rendering API designed for the web. This is Version 2 of the
110 WebGL specification. It is derived from OpenGL® ES 3.0, and provides similar rendering
111 functionality, but in an HTML context.
115 WebGL 2 is backwards compatible with WebGL 1: existing content will run in WebGL 2 without
116 modification. To access the new behavior provided in this specification, the content
117 explicitly requests a new context (<a href="#">details below</a>).
124 Many functions described in this document contain links to OpenGL ES
125 man pages. While every effort is made to make these pages match the
126 OpenGL ES 3.0 specification <a href="#refsGLES30">[GLES30]</a>,
127 they may contain errors. In the case of a contradiction, the OpenGL
128 ES 3.0 specification is the final authority.
132 The remaining sections of this document are intended to be read in conjunction
133 with the OpenGL ES 3.0 specification (3.0.2 at the time of this writing, available
134 from the <a href="http://www.khronos.org/registry/gles/">Khronos OpenGL ES API Registry</a>).
135 Unless otherwise specified, the behavior of each method is defined by the
136 OpenGL ES 3.0 specification. This specification may diverge from OpenGL ES 3.0
137 in order to ensure interoperability or security, often defining areas that
138 OpenGL ES 3.0 leaves implementation-defined. These differences are summarized in the
139 <a href="#webgl_gl_differences">Differences Between WebGL and OpenGL ES 3.0</a> section.
142 <!-- ======================================================================================================= -->
144 <h2>Context Creation and Drawing Buffer Presentation</h2>
147 Before using the WebGL API, the author must obtain a <code>WebGLRenderingContext</code>
148 object for a given HTMLCanvasElement <a href="#refsCANVAS">[CANVAS]</a> as described
149 below. This object is used to manage OpenGL state and render to the drawing buffer, which
150 must be created at the time of context creation.
153 <!-- ======================================================================================================= -->
155 <h3>Context Creation</h3>
158 Each <code>WebGLRenderingContext</code> and <code>WebGL2RenderingContext</code> has an
159 associated <b><a name="context-canvas">canvas</a></b>, set upon creation, which is
160 a <em>canvas</em> <a href="#refsCANVAS">[CANVAS]</a>.
163 Each <code>WebGLRenderingContext</code> and <code>WebGL2RenderingContext</code> has <b><a name="context-creation-parameters">context
164 creation parameters</a></b>, set upon creation, in
165 a <a href="../1.0/#WEBGLCONTEXTATTRIBUTES"><code>WebGLContextAttributes</code></a> object.
168 Each <code>WebGLRenderingContext</code> and <code>WebGL2RenderingContext</code> has <b><a name="actual-context-parameters">actual
169 context parameters</a></b>, set each time the drawing buffer is created, in
170 a <a href="../1.0/#WEBGLCONTEXTATTRIBUTES"><code>WebGLContextAttributes</code></a> object.
173 Each <code>WebGLRenderingContext</code> and <code>WebGL2RenderingContext</code> has a <b><a name="webgl-context-lost-flag">webgl
174 context lost flag</a></b>, which is initially unset.
177 When the <code>getContext()</code> method of a <code>canvas</code> element is to return a
179 the <em>contextId</em> <code>webgl2</code> <a href="#refsCANVASCONTEXTS">[CANVASCONTEXTS]</a>,
180 the user agent must perform the following steps:
182 <ol class="nestedlist">
184 <li> Create a new <code>WebGL2RenderingContext</code> object, <em>context</em>.
186 <li> Let <em>context's</em> <a href="#context-canvas">canvas</a> be the canvas
187 the <code>getContext()</code> method is associated with.
189 <li> Create a new <code>WebGLContextAttributes</code> object, <em>contextAttributes</em>.
191 <li> If <code>getContext()</code> was invoked with a second argument, <em>options</em>, set
192 the attributes of <em>contextAttributes</em> from those specified in <em>options</em>.
194 <li> <a href="#create-a-drawing-buffer">Create a <em>drawing buffer</em></a> using the settings
195 specified in <em>contextAttributes</em>, and associate the <em>drawing buffer</em>
196 with <em>context</em>.
198 <li> If drawing buffer creation failed, perform the following steps:
200 <ol class="nestedlist">
202 <li> <a href="#fire-a-webgl-context-creation-error">Fire a WebGL context creation
203 error</a> at <em>canvas</em>.
205 <li> Return null and terminate these steps.
209 <li> Set the attributes of <em>contextAttributes</em> based on the properties of the newly
210 created drawing buffer.
212 <li> Set <em>context's</em> <a href="#context-creation-parameters">context creation
213 parameters</a> to <em>contextAttributes</em>.
215 <li> Return <em>context</em>.
220 <!-- ======================================================================================================= -->
222 <h2>DOM Interfaces</h2>
225 This section describes the interfaces and functionality added to the
226 DOM to support runtime access to the functionality described above.
229 <!-- ======================================================================================================= -->
234 The following types are introduced in WebGL 2.0.
237 typedef long long GLint64;
238 typedef unsigned long long GLuint64;
241 <!-- ======================================================================================================= -->
246 The <code>WebGLQuery</code> interface represents an OpenGL Query Object.
247 The underlying object is created as if by calling glGenQueries
248 <span class="gl-spec">
249 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.13">OpenGL ES 3.0.3 §2.13</a>,
250 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGenQueries.xhtml">man page</a>)
252 made active as if by calling glBeginQuery
253 <span class="gl-spec">
254 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.13">OpenGL ES 3.0.3 §2.13</a>,
255 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBeginQuery.xhtml">man page</a>)
257 concluded as if by calling glEndQuery
258 <span class="gl-spec">
259 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.13">OpenGL ES 3.0.3 §2.13</a>,
260 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBeginQuery.xhtml">man page</a>)
262 and destroyed as if by calling glDeleteQueries
263 <span class="gl-spec">
264 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.13">OpenGL ES 3.0.3 §2.13</a>,
265 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteQueries.xhtml">man page</a>)
268 <pre class="idl">interface <dfn id="WebGLQuery">WebGLQuery</dfn> : WebGLObject {
271 <!-- ======================================================================================================= -->
273 <h3>WebGLSampler</h3>
276 The <code>WebGLSampler</code> interface represents an OpenGL Sampler Object.
277 The underlying object is created as if by calling glGenSamplers
278 <span class="gl-spec">
279 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.2">OpenGL ES 3.0.3 §3.8.2</a>,
280 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGenSamplers.xhtml">man page</a>)
282 bound as if by calling glBindSampler
283 <span class="gl-spec">
284 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.2">OpenGL ES 3.0.3 §3.8.2</a>,
285 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBindSampler.xhtml">man page</a>)
287 and destroyed as if by calling glDeleteSamplers
288 <span class="gl-spec">
289 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.2">OpenGL ES 3.0.3 §3.8.2</a>,
290 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteSamplers.xhtml">man page</a>)
293 <pre class="idl">interface <dfn id="WebGLSampler">WebGLSampler</dfn> : WebGLObject {
296 <!-- ======================================================================================================= -->
301 The <code>WebGLSync</code> interface represents an OpenGL Sync Object.
302 The underlying object is created as if by calling glFenceSync
303 <span class="gl-spec">
304 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-5.2">OpenGL ES 3.0.3 §5.2</a>,
305 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glFenceSync.xhtml">man page</a>)
307 blocked on as if by calling glClientWaitSync
308 <span class="gl-spec">
309 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-5.2.1">OpenGL ES 3.0.3 §5.2.1</a>,
310 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glClientWaitSync.xhtml">man page</a>)
312 waited on internal to GL as if by calling glWaitSync
313 <span class="gl-spec">
314 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-5.2.1">OpenGL ES 3.0.3 §5.2.1</a>,
315 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glWaitSync.xhtml">man page</a>)
317 queried as if by calling glGetSynciv
318 <span class="gl-spec">
319 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.8">OpenGL ES 3.0.3 §6.2.8</a>,
320 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGetSynciv.xhtml">man page</a>)
322 and destroyed as if by calling glDeleteSync
323 <span class="gl-spec">
324 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-5.2">OpenGL ES 3.0.3 §5.2</a>,
325 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteSync.xhtml">man page</a>)
330 <pre class="idl">interface <dfn id="WebGLSync">WebGLSync</dfn> : WebGLObject {
333 <!-- ======================================================================================================= -->
335 <h3>WebGLTransformFeedback</h3>
338 The <code>WebGLTransformFeedback</code> interface represents an OpenGL Transform Feedback Object.
339 The underlying object is created as if by calling glGenTransformFeedbacks
340 <span class="gl-spec">
341 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.14.1">OpenGL ES 3.0.3 §2.14.1</a>,
342 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGenTransformFeedbacks.xhtml">man page</a>)
344 bound as if by calling glBindTransformFeedback
345 <span class="gl-spec">
346 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.14.1">OpenGL ES 3.0.3 §2.14.1</a>,
347 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBindTransformFeedback.xhtml">man page</a>)
349 and destroyed as if by calling glDeleteTransformFeedbacks
350 <span class="gl-spec">
351 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.14.1">OpenGL ES 3.0.3 §2.14.1</a>,
352 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteTransformFeedbacks.xhtml">man page</a>)
355 <pre class="idl">interface <dfn id="WebGLTransformFeedback">WebGLTransformFeedback</dfn> : WebGLObject {
358 <!-- ======================================================================================================= -->
360 <h3>WebGLVertexArrayObject</h3>
363 The <code>WebGLVertexArrayObject</code> interface represents an OpenGL Vertex Array Object.
364 The underlying object is created as if by calling glGenVertexArrays
365 <span class="gl-spec">
366 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.10">OpenGL ES 3.0.3 §2.10</a>,
367 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGenVertexArrays.xhtml">man page</a>)
369 bound as if by calling glBindVertexArray
370 <span class="gl-spec">
371 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.10">OpenGL ES 3.0.3 §2.10</a>,
372 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBindVertexArray.xhtml">man page</a>)
374 and destroyed as if by calling glDeleteVertexArrays
375 <span class="gl-spec">
376 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.10">OpenGL ES 3.0.3 §2.10</a>,
377 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteVertexArrays.xhtml">man page</a>)
380 <pre class="idl">interface <dfn id="WebGLVertexArrayObject">WebGLVertexArrayObject</dfn> : WebGLObject {
383 <!-- ======================================================================================================= -->
385 <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3>
388 The <code>WebGL2RenderingContext</code> represents the API allowing
389 OpenGL ES 3.0 style rendering into the canvas element.
394 interface <dfn id="WebGL2RenderingContextBase">WebGL2RenderingContextBase</dfn>
396 const GLenum READ_BUFFER = 0x0C02;
397 const GLenum UNPACK_ROW_LENGTH = 0x0CF2;
398 const GLenum UNPACK_SKIP_ROWS = 0x0CF3;
399 const GLenum UNPACK_SKIP_PIXELS = 0x0CF4;
400 const GLenum PACK_ROW_LENGTH = 0x0D02;
401 const GLenum PACK_SKIP_ROWS = 0x0D03;
402 const GLenum PACK_SKIP_PIXELS = 0x0D04;
403 const GLenum COLOR = 0x1800;
404 const GLenum DEPTH = 0x1801;
405 const GLenum STENCIL = 0x1802;
406 const GLenum RED = 0x1903;
407 const GLenum RGB8 = 0x8051;
408 const GLenum RGBA8 = 0x8058;
409 const GLenum RGB10_A2 = 0x8059;
410 const GLenum TEXTURE_BINDING_3D = 0x806A;
411 const GLenum UNPACK_SKIP_IMAGES = 0x806D;
412 const GLenum UNPACK_IMAGE_HEIGHT = 0x806E;
413 const GLenum TEXTURE_3D = 0x806F;
414 const GLenum TEXTURE_WRAP_R = 0x8072;
415 const GLenum MAX_3D_TEXTURE_SIZE = 0x8073;
416 const GLenum UNSIGNED_INT_2_10_10_10_REV = 0x8368;
417 const GLenum MAX_ELEMENTS_VERTICES = 0x80E8;
418 const GLenum MAX_ELEMENTS_INDICES = 0x80E9;
419 const GLenum TEXTURE_MIN_LOD = 0x813A;
420 const GLenum TEXTURE_MAX_LOD = 0x813B;
421 const GLenum TEXTURE_BASE_LEVEL = 0x813C;
422 const GLenum TEXTURE_MAX_LEVEL = 0x813D;
423 const GLenum MIN = 0x8007;
424 const GLenum MAX = 0x8008;
425 const GLenum DEPTH_COMPONENT24 = 0x81A6;
426 const GLenum MAX_TEXTURE_LOD_BIAS = 0x84FD;
427 const GLenum TEXTURE_COMPARE_MODE = 0x884C;
428 const GLenum TEXTURE_COMPARE_FUNC = 0x884D;
429 const GLenum CURRENT_QUERY = 0x8865;
430 const GLenum QUERY_RESULT = 0x8866;
431 const GLenum QUERY_RESULT_AVAILABLE = 0x8867;
432 const GLenum STREAM_READ = 0x88E1;
433 const GLenum STREAM_COPY = 0x88E2;
434 const GLenum STATIC_READ = 0x88E5;
435 const GLenum STATIC_COPY = 0x88E6;
436 const GLenum DYNAMIC_READ = 0x88E9;
437 const GLenum DYNAMIC_COPY = 0x88EA;
438 const GLenum MAX_DRAW_BUFFERS = 0x8824;
439 const GLenum DRAW_BUFFER0 = 0x8825;
440 const GLenum DRAW_BUFFER1 = 0x8826;
441 const GLenum DRAW_BUFFER2 = 0x8827;
442 const GLenum DRAW_BUFFER3 = 0x8828;
443 const GLenum DRAW_BUFFER4 = 0x8829;
444 const GLenum DRAW_BUFFER5 = 0x882A;
445 const GLenum DRAW_BUFFER6 = 0x882B;
446 const GLenum DRAW_BUFFER7 = 0x882C;
447 const GLenum DRAW_BUFFER8 = 0x882D;
448 const GLenum DRAW_BUFFER9 = 0x882E;
449 const GLenum DRAW_BUFFER10 = 0x882F;
450 const GLenum DRAW_BUFFER11 = 0x8830;
451 const GLenum DRAW_BUFFER12 = 0x8831;
452 const GLenum DRAW_BUFFER13 = 0x8832;
453 const GLenum DRAW_BUFFER14 = 0x8833;
454 const GLenum DRAW_BUFFER15 = 0x8834;
455 const GLenum MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49;
456 const GLenum MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A;
457 const GLenum SAMPLER_3D = 0x8B5F;
458 const GLenum SAMPLER_2D_SHADOW = 0x8B62;
459 const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B;
460 const GLenum PIXEL_PACK_BUFFER = 0x88EB;
461 const GLenum PIXEL_UNPACK_BUFFER = 0x88EC;
462 const GLenum PIXEL_PACK_BUFFER_BINDING = 0x88ED;
463 const GLenum PIXEL_UNPACK_BUFFER_BINDING = 0x88EF;
464 const GLenum FLOAT_MAT2x3 = 0x8B65;
465 const GLenum FLOAT_MAT2x4 = 0x8B66;
466 const GLenum FLOAT_MAT3x2 = 0x8B67;
467 const GLenum FLOAT_MAT3x4 = 0x8B68;
468 const GLenum FLOAT_MAT4x2 = 0x8B69;
469 const GLenum FLOAT_MAT4x3 = 0x8B6A;
470 const GLenum SRGB = 0x8C40;
471 const GLenum SRGB8 = 0x8C41;
472 const GLenum SRGB8_ALPHA8 = 0x8C43;
473 const GLenum COMPARE_REF_TO_TEXTURE = 0x884E;
474 const GLenum RGBA32F = 0x8814;
475 const GLenum RGB32F = 0x8815;
476 const GLenum RGBA16F = 0x881A;
477 const GLenum RGB16F = 0x881B;
478 const GLenum VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD;
479 const GLenum MAX_ARRAY_TEXTURE_LAYERS = 0x88FF;
480 const GLenum MIN_PROGRAM_TEXEL_OFFSET = 0x8904;
481 const GLenum MAX_PROGRAM_TEXEL_OFFSET = 0x8905;
482 const GLenum MAX_VARYING_COMPONENTS = 0x8B4B;
483 const GLenum TEXTURE_2D_ARRAY = 0x8C1A;
484 const GLenum TEXTURE_BINDING_2D_ARRAY = 0x8C1D;
485 const GLenum R11F_G11F_B10F = 0x8C3A;
486 const GLenum UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B;
487 const GLenum RGB9_E5 = 0x8C3D;
488 const GLenum UNSIGNED_INT_5_9_9_9_REV = 0x8C3E;
489 const GLenum TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F;
490 const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80;
491 const GLenum TRANSFORM_FEEDBACK_VARYINGS = 0x8C83;
492 const GLenum TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84;
493 const GLenum TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85;
494 const GLenum TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88;
495 const GLenum RASTERIZER_DISCARD = 0x8C89;
496 const GLenum MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
497 const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B;
498 const GLenum INTERLEAVED_ATTRIBS = 0x8C8C;
499 const GLenum SEPARATE_ATTRIBS = 0x8C8D;
500 const GLenum TRANSFORM_FEEDBACK_BUFFER = 0x8C8E;
501 const GLenum TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F;
502 const GLenum RGBA32UI = 0x8D70;
503 const GLenum RGB32UI = 0x8D71;
504 const GLenum RGBA16UI = 0x8D76;
505 const GLenum RGB16UI = 0x8D77;
506 const GLenum RGBA8UI = 0x8D7C;
507 const GLenum RGB8UI = 0x8D7D;
508 const GLenum RGBA32I = 0x8D82;
509 const GLenum RGB32I = 0x8D83;
510 const GLenum RGBA16I = 0x8D88;
511 const GLenum RGB16I = 0x8D89;
512 const GLenum RGBA8I = 0x8D8E;
513 const GLenum RGB8I = 0x8D8F;
514 const GLenum RED_INTEGER = 0x8D94;
515 const GLenum RGB_INTEGER = 0x8D98;
516 const GLenum RGBA_INTEGER = 0x8D99;
517 const GLenum SAMPLER_2D_ARRAY = 0x8DC1;
518 const GLenum SAMPLER_2D_ARRAY_SHADOW = 0x8DC4;
519 const GLenum SAMPLER_CUBE_SHADOW = 0x8DC5;
520 const GLenum UNSIGNED_INT_VEC2 = 0x8DC6;
521 const GLenum UNSIGNED_INT_VEC3 = 0x8DC7;
522 const GLenum UNSIGNED_INT_VEC4 = 0x8DC8;
523 const GLenum INT_SAMPLER_2D = 0x8DCA;
524 const GLenum INT_SAMPLER_3D = 0x8DCB;
525 const GLenum INT_SAMPLER_CUBE = 0x8DCC;
526 const GLenum INT_SAMPLER_2D_ARRAY = 0x8DCF;
527 const GLenum UNSIGNED_INT_SAMPLER_2D = 0x8DD2;
528 const GLenum UNSIGNED_INT_SAMPLER_3D = 0x8DD3;
529 const GLenum UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4;
530 const GLenum UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7;
531 const GLenum DEPTH_COMPONENT32F = 0x8CAC;
532 const GLenum DEPTH32F_STENCIL8 = 0x8CAD;
533 const GLenum FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
534 const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210;
535 const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211;
536 const GLenum FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212;
537 const GLenum FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213;
538 const GLenum FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214;
539 const GLenum FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215;
540 const GLenum FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216;
541 const GLenum FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217;
542 const GLenum FRAMEBUFFER_DEFAULT = 0x8218;
543 const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A;
544 const GLenum DEPTH_STENCIL = 0x84F9;
545 const GLenum UNSIGNED_INT_24_8 = 0x84FA;
546 const GLenum DEPTH24_STENCIL8 = 0x88F0;
547 const GLenum UNSIGNED_NORMALIZED = 0x8C17;
548 const GLenum DRAW_FRAMEBUFFER_BINDING = 0x8CA6; /* Same as FRAMEBUFFER_BINDING */
549 const GLenum READ_FRAMEBUFFER = 0x8CA8;
550 const GLenum DRAW_FRAMEBUFFER = 0x8CA9;
551 const GLenum READ_FRAMEBUFFER_BINDING = 0x8CAA;
552 const GLenum RENDERBUFFER_SAMPLES = 0x8CAB;
553 const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
554 const GLenum MAX_COLOR_ATTACHMENTS = 0x8CDF;
555 const GLenum COLOR_ATTACHMENT1 = 0x8CE1;
556 const GLenum COLOR_ATTACHMENT2 = 0x8CE2;
557 const GLenum COLOR_ATTACHMENT3 = 0x8CE3;
558 const GLenum COLOR_ATTACHMENT4 = 0x8CE4;
559 const GLenum COLOR_ATTACHMENT5 = 0x8CE5;
560 const GLenum COLOR_ATTACHMENT6 = 0x8CE6;
561 const GLenum COLOR_ATTACHMENT7 = 0x8CE7;
562 const GLenum COLOR_ATTACHMENT8 = 0x8CE8;
563 const GLenum COLOR_ATTACHMENT9 = 0x8CE9;
564 const GLenum COLOR_ATTACHMENT10 = 0x8CEA;
565 const GLenum COLOR_ATTACHMENT11 = 0x8CEB;
566 const GLenum COLOR_ATTACHMENT12 = 0x8CEC;
567 const GLenum COLOR_ATTACHMENT13 = 0x8CED;
568 const GLenum COLOR_ATTACHMENT14 = 0x8CEE;
569 const GLenum COLOR_ATTACHMENT15 = 0x8CEF;
570 const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
571 const GLenum MAX_SAMPLES = 0x8D57;
572 const GLenum HALF_FLOAT = 0x140B;
573 const GLenum RG = 0x8227;
574 const GLenum RG_INTEGER = 0x8228;
575 const GLenum R8 = 0x8229;
576 const GLenum RG8 = 0x822B;
577 const GLenum R16F = 0x822D;
578 const GLenum R32F = 0x822E;
579 const GLenum RG16F = 0x822F;
580 const GLenum RG32F = 0x8230;
581 const GLenum R8I = 0x8231;
582 const GLenum R8UI = 0x8232;
583 const GLenum R16I = 0x8233;
584 const GLenum R16UI = 0x8234;
585 const GLenum R32I = 0x8235;
586 const GLenum R32UI = 0x8236;
587 const GLenum RG8I = 0x8237;
588 const GLenum RG8UI = 0x8238;
589 const GLenum RG16I = 0x8239;
590 const GLenum RG16UI = 0x823A;
591 const GLenum RG32I = 0x823B;
592 const GLenum RG32UI = 0x823C;
593 const GLenum VERTEX_ARRAY_BINDING = 0x85B5;
594 const GLenum R8_SNORM = 0x8F94;
595 const GLenum RG8_SNORM = 0x8F95;
596 const GLenum RGB8_SNORM = 0x8F96;
597 const GLenum RGBA8_SNORM = 0x8F97;
598 const GLenum SIGNED_NORMALIZED = 0x8F9C;
599 const GLenum PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69;
600 const GLenum COPY_READ_BUFFER = 0x8F36;
601 const GLenum COPY_WRITE_BUFFER = 0x8F37;
602 const GLenum COPY_READ_BUFFER_BINDING = 0x8F36; /* Same as COPY_READ_BUFFER */
603 const GLenum COPY_WRITE_BUFFER_BINDING = 0x8F37; /* Same as COPY_WRITE_BUFFER */
604 const GLenum UNIFORM_BUFFER = 0x8A11;
605 const GLenum UNIFORM_BUFFER_BINDING = 0x8A28;
606 const GLenum UNIFORM_BUFFER_START = 0x8A29;
607 const GLenum UNIFORM_BUFFER_SIZE = 0x8A2A;
608 const GLenum MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B;
609 const GLenum MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D;
610 const GLenum MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E;
611 const GLenum MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F;
612 const GLenum MAX_UNIFORM_BLOCK_SIZE = 0x8A30;
613 const GLenum MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
614 const GLenum MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
615 const GLenum UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
616 const GLenum ACTIVE_UNIFORM_BLOCKS = 0x8A36;
617 const GLenum UNIFORM_TYPE = 0x8A37;
618 const GLenum UNIFORM_SIZE = 0x8A38;
619 const GLenum UNIFORM_BLOCK_INDEX = 0x8A3A;
620 const GLenum UNIFORM_OFFSET = 0x8A3B;
621 const GLenum UNIFORM_ARRAY_STRIDE = 0x8A3C;
622 const GLenum UNIFORM_MATRIX_STRIDE = 0x8A3D;
623 const GLenum UNIFORM_IS_ROW_MAJOR = 0x8A3E;
624 const GLenum UNIFORM_BLOCK_BINDING = 0x8A3F;
625 const GLenum UNIFORM_BLOCK_DATA_SIZE = 0x8A40;
626 const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42;
627 const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
628 const GLenum UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
629 const GLenum UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
630 const GLenum INVALID_INDEX = 0xFFFFFFFF;
631 const GLenum MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122;
632 const GLenum MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125;
633 const GLenum MAX_SERVER_WAIT_TIMEOUT = 0x9111;
634 const GLenum OBJECT_TYPE = 0x9112;
635 const GLenum SYNC_CONDITION = 0x9113;
636 const GLenum SYNC_STATUS = 0x9114;
637 const GLenum SYNC_FLAGS = 0x9115;
638 const GLenum SYNC_FENCE = 0x9116;
639 const GLenum SYNC_GPU_COMMANDS_COMPLETE = 0x9117;
640 const GLenum UNSIGNALED = 0x9118;
641 const GLenum SIGNALED = 0x9119;
642 const GLenum ALREADY_SIGNALED = 0x911A;
643 const GLenum TIMEOUT_EXPIRED = 0x911B;
644 const GLenum CONDITION_SATISFIED = 0x911C;
645 const GLenum WAIT_FAILED = 0x911D;
646 const GLenum SYNC_FLUSH_COMMANDS_BIT = 0x00000001;
647 const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE;
648 const GLenum ANY_SAMPLES_PASSED = 0x8C2F;
649 const GLenum ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A;
650 const GLenum SAMPLER_BINDING = 0x8919;
651 const GLenum RGB10_A2UI = 0x906F;
652 const GLenum TEXTURE_SWIZZLE_R = 0x8E42;
653 const GLenum TEXTURE_SWIZZLE_G = 0x8E43;
654 const GLenum TEXTURE_SWIZZLE_B = 0x8E44;
655 const GLenum TEXTURE_SWIZZLE_A = 0x8E45;
656 const GLenum GREEN = 0x1904;
657 const GLenum BLUE = 0x1905;
658 const GLenum INT_2_10_10_10_REV = 0x8D9F;
659 const GLenum TRANSFORM_FEEDBACK = 0x8E22;
660 const GLenum TRANSFORM_FEEDBACK_PAUSED = 0x8E23;
661 const GLenum TRANSFORM_FEEDBACK_ACTIVE = 0x8E24;
662 const GLenum TRANSFORM_FEEDBACK_BINDING = 0x8E25;
663 const GLenum COMPRESSED_R11_EAC = 0x9270;
664 const GLenum COMPRESSED_SIGNED_R11_EAC = 0x9271;
665 const GLenum COMPRESSED_RG11_EAC = 0x9272;
666 const GLenum COMPRESSED_SIGNED_RG11_EAC = 0x9273;
667 const GLenum COMPRESSED_RGB8_ETC2 = 0x9274;
668 const GLenum COMPRESSED_SRGB8_ETC2 = 0x9275;
669 const GLenum COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
670 const GLenum COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
671 const GLenum COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
672 const GLenum COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
673 const GLenum TEXTURE_IMMUTABLE_FORMAT = 0x912F;
674 const GLenum MAX_ELEMENT_INDEX = 0x8D6B;
675 const GLenum NUM_SAMPLE_COUNTS = 0x9380;
676 const GLenum TEXTURE_IMMUTABLE_LEVELS = 0x82DF;
678 const GLuint64 TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFF;
681 void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset,
682 GLintptr writeOffset, GLsizeiptr size);
683 // MapBufferRange, in particular its read-only and write-only modes,
684 // can not be exposed safely to JavaScript. GetBufferSubData
685 // replaces it for the purpose of fetching data back from the GPU.
686 typedef (ArrayBuffer or ArrayBufferView) GetBufferDataDest;
687 void getBufferSubData(GLenum target, GLintptr offset, GetBufferDataDest returnedData);
689 /* Framebuffer objects */
690 void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0,
691 GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
692 void framebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level,
694 any getInternalformatParameter(GLenum target, GLenum internalformat, GLenum pname);
695 void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments);
696 void invalidateSubFramebuffer(GLenum target, sequence<GLenum> attachments,
697 GLint x, GLint y, GLsizei width, GLsizei height);
698 void readBuffer(GLenum mode);
700 /* Renderbuffer objects */
701 void renderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat,
702 GLsizei width, GLsizei height);
704 /* Texture objects */
705 void texStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
706 void texStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height,
708 void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
709 GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
710 ArrayBufferView? pixels);
711 void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
712 GLenum format, GLenum type, TexImageSource? source);
713 void copyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
714 GLint x, GLint y, GLsizei width, GLsizei height);
715 void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat,
716 GLsizei width, GLsizei height, GLsizei depth,
717 GLint border, GLsizei imageSize, ArrayBufferView data);
718 void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
719 GLsizei width, GLsizei height, GLsizei depth,
720 GLenum format, GLsizei imageSize, ArrayBufferView data);
722 /* Programs and shaders */
723 [WebGLHandlesContextLoss] GLint getFragDataLocation(WebGLProgram? program, DOMString name);
725 /* Uniforms and attributes */
726 void uniform1ui(WebGLUniformLocation? location, GLuint v0);
727 void uniform2ui(WebGLUniformLocation? location, GLuint v0, GLuint v1);
728 void uniform3ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2);
729 void uniform4ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
730 void uniform1uiv(WebGLUniformLocation? location, sequence<GLuint> value);
731 void uniform2uiv(WebGLUniformLocation? location, sequence<GLuint> value);
732 void uniform3uiv(WebGLUniformLocation? location, sequence<GLuint> value);
733 void uniform4uiv(WebGLUniformLocation? location, sequence<GLuint> value);
734 typedef (Float32Array or sequence<GLfloat>) UniformMatrixFVSource;
735 void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, UniformMatrixFVSource value);
736 void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, UniformMatrixFVSource value);
737 void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, UniformMatrixFVSource value);
738 void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, UniformMatrixFVSource value);
739 void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, UniformMatrixFVSource value);
740 void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, UniformMatrixFVSource value);
741 void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
742 void vertexAttribI4iv(GLuint index, sequence<GLint> v);
743 void vertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
744 void vertexAttribI4uiv(GLuint index, sequence<GLuint> v);
745 void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
747 /* Writing to the drawing buffer */
748 void vertexAttribDivisor(GLuint index, GLuint divisor);
749 void drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount);
750 void drawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount);
751 /* TODO(kbr): argue against exposing this because it can't safely
752 offer better performance than drawElements */
753 void drawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLintptr offset);
755 /* Multiple Render Targets */
756 void drawBuffers(sequence<GLenum> buffers);
757 typedef (Int32Array or sequence<GLint>) ClearBufferIVSource;
758 typedef (Uint32Array or sequence<GLuint>) ClearBufferUIVSource;
759 typedef (Float32Array or sequence<GLfloat>) ClearBufferFVSource;
760 void clearBufferiv(GLenum buffer, GLint drawbuffer, ClearBufferIVSource value);
761 void clearBufferuiv(GLenum buffer, GLint drawbuffer, ClearBufferUIVSource value);
762 void clearBufferfv(GLenum buffer, GLint drawbuffer, ClearBufferFVSource value);
763 void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
766 WebGLQuery? createQuery();
767 void deleteQuery(WebGLQuery? query);
768 [WebGLHandlesContextLoss] GLboolean isQuery(WebGLQuery? query);
769 void beginQuery(GLenum target, WebGLQuery? query);
770 void endQuery(GLenum target);
771 WebGLQuery? getQuery(GLenum target, GLenum pname);
772 any getQueryParameter(WebGLQuery? query, GLenum pname);
774 /* Sampler Objects */
775 WebGLSampler? createSampler();
776 void deleteSampler(WebGLSampler? sampler);
777 [WebGLHandlesContextLoss] GLboolean isSampler(WebGLSampler? sampler);
778 void bindSampler(GLuint unit, WebGLSampler? sampler);
779 void samplerParameteri(WebGLSampler? sampler, GLenum pname, GLint param);
780 typedef (Int32Array or sequence<GLint>) SamplerParameterIVSource;
781 void samplerParameteriv(WebGLSampler? sampler, GLenum pname, SamplerParameterIVSource param);
782 void samplerParameterf(WebGLSampler? sampler, GLenum pname, GLfloat param);
783 typedef (Float32Array or sequence<GLfloat>) SamplerParameterFVSource;
784 void samplerParameterfv(WebGLSampler? sampler, GLenum pname, SamplerParameterFVSource param);
785 any getSamplerParameter(WebGLSampler? sampler, GLenum pname);
788 WebGLSync? fenceSync(GLenum condition, GLbitfield flags);
789 [WebGLHandlesContextLoss] GLboolean isSync(WebGLSync? sync);
790 void deleteSync(WebGLSync? sync);
791 GLenum clientWaitSync(WebGLSync? sync, GLbitfield flags, GLuint64 timeout);
792 void waitSync(WebGLSync? sync, GLbitfield flags, GLuint64 timeout);
793 any getSyncParameter(WebGLSync? sync, GLenum pname);
795 /* Transform Feedback */
796 WebGLTransformFeedback? createTransformFeedback();
797 void deleteTransformFeedback(WebGLTransformFeedback?);
798 [WebGLHandlesContextLoss] GLboolean isTransformFeedback(WebGLTransformFeedback?);
799 void bindTransformFeedback (GLenum target, WebGLTransformFeedback? id);
800 void beginTransformFeedback(GLenum primitiveMode);
801 void endTransformFeedback();
802 void transformFeedbackVaryings(WebGLProgram? program, sequence<DOMString> varyings, GLenum bufferMode);
803 WebGLActiveInfo? getTransformFeedbackVarying(WebGLProgram? program, GLuint index);
804 void pauseTransformFeedback();
805 void resumeTransformFeedback();
807 /* Uniform Buffer Objects and Transform Feedback Buffers */
808 void bindBufferBase(GLenum target, GLuint index, WebGLBuffer? buffer);
809 void bindBufferRange(GLenum target, GLuint index, WebGLBuffer? buffer, GLintptr offset, GLsizeiptr size);
810 any getIndexedParameter(GLenum target, GLuint index);
811 sequence<GLuint>? getUniformIndices(WebGLProgram? program, sequence<DOMString> uniformNames);
812 sequence<GLint>? getActiveUniforms(WebGLProgram? program, sequence<GLuint> uniformIndices, GLenum pname);
813 GLuint getUniformBlockIndex(WebGLProgram? program, DOMString uniformBlockName);
814 any getActiveUniformBlockParameter(WebGLProgram? program, GLuint uniformBlockIndex, GLenum pname);
815 /* TODO: if there were a fake enum for GL_UNIFORM_BLOCK_NAME, then this could be folded into getActiveUniformBlockParameter */
816 DOMString? getActiveUniformBlockName(WebGLProgram? program, GLuint uniformBlockIndex);
817 void uniformBlockBinding(WebGLProgram? program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
819 /* Vertex Array Objects */
820 WebGLVertexArrayObject? createVertexArray();
821 void deleteVertexArray(WebGLVertexArrayObject? vertexArray);
822 [WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
823 void bindVertexArray(WebGLVertexArrayObject? array);
825 WebGL2RenderingContextBase implements WebGLRenderingContextBase;
827 interface <dfn id="WebGL2RenderingContext">WebGL2RenderingContext</dfn>
830 WebGL2RenderingContext implements WebGL2RenderingContextBase;
834 <!-- ======================================================================================================= -->
836 <h4>Setting and getting state</h4>
839 <dt class="idl-code"><a name="GETPARAMETER">any getParameter</a>(GLenum pname)
840 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.1">OpenGL ES 3.0.3 §6.1.1</a>,
841 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGet.xhtml">glGet OpenGL ES 3.0 man page</a>,
842 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetString.xhtml">glGetString OpenGL ES 3.0 man page</a>)</span>
844 Return the value for the passed pname. As well as supporting all
845 the pname/type values from WebGL 1.0, the following parameters are supported:
847 <tr><th>pname</th><th>returned type</th></tr>
848 <tr><td>COPY_READ_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
849 <tr><td>COPY_WRITE_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
850 <tr><td>DRAW_BINDING</td><td>GLenum</td></tr>
851 <tr><td>DRAW_FRAMEBUFFER_BINDING</td><td>WebGLFramebuffer</td></tr>
852 <tr><td>FRAGMENT_SHADER_DERIVATIVE_HINT</td><td>GLenum</td></tr>
853 <tr><td>IMPLEMENTATION_COLOR_READ_FORMAT</td><td>GLenum</td></tr>
854 <tr><td>IMPLEMENTATION_COLOR_READ_TYPE</td><td>GLenum</td></tr>
855 <tr><td>MAX_3D_TEXTURE_SIZE</td><td>GLint</td></tr>
856 <tr><td>MAX_ARRAY_TEXTURE_LAYERS</td><td>GLint</td></tr>
857 <tr><td>MAX_COLOR_ATTACHMENTS</td><td>GLint</td></tr>
858 <tr><td>MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS</td><td>GLint64</td></tr>
859 <tr><td>MAX_COMBINED_UNIFORM_BLOCKS</td><td>GLint</td></tr>
860 <tr><td>MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS</td><td>GLint64</td></tr>
861 <tr><td>MAX_DRAW_BUFFERS</td><td>GLint</td></tr>
862 <tr><td>MAX_ELEMENT_INDEX</td><td>GLint64</td></tr>
863 <tr><td>MAX_ELEMENTS_INDICES</td><td>GLint</td></tr>
864 <tr><td>MAX_ELEMENTS_VERTICES</td><td>GLint</td></tr>
865 <tr><td>MAX_FRAGMENT_INPUT_COMPONENTS</td><td>GLint</td></tr>
866 <tr><td>MAX_FRAGMENT_UNIFORM_BLOCKS</td><td>GLint</td></tr>
867 <tr><td>MAX_FRAGMENT_UNIFORM_COMPONENTS</td><td>GLint</td></tr>
868 <tr><td>MAX_PROGRAM_TEXEL_OFFSET</td><td>GLint</td></tr>
869 <tr><td>MAX_SAMPLES</td><td>GLint</td></tr>
870 <tr><td>MAX_SERVER_WAIT_TIMEOUT</td><td>GLint64</td></tr>
871 <tr><td>MAX_TEXTURE_LOD_BIAS</td><td>GLint</td></tr>
872 <tr><td>MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS</td><td>GLint</td></tr>
873 <tr><td>MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS</td><td>GLint</td></tr>
874 <tr><td>MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS</td><td>GLint</td></tr>
875 <tr><td>MAX_UNIFORM_BLOCK_SIZE</td><td>GLint64</td></tr>
876 <tr><td>MAX_UNIFORM_BUFFER_BINDINGS</td><td>GLint</td></tr>
877 <tr><td>MAX_VARYING_COMPONENTS</td><td>GLint</td></tr>
878 <tr><td>MAX_VERTEX_OUTPUT_COMPONENTS</td><td>GLint</td></tr>
879 <tr><td>MAX_VERTEX_UNIFORM_BLOCKS</td><td>GLint</td></tr>
880 <tr><td>MAX_VERTEX_UNIFORM_COMPONENTS</td><td>GLint</td></tr>
881 <tr><td>MIN_PROGRAM_TEXEL_OFFSET</td><td>GLint</td></tr>
882 <tr><td>PACK_IMAGE_HEIGHT</td><td>GLint</td></tr>
883 <tr><td>PACK_ROW_LENGTH</td><td>GLint</td></tr>
884 <tr><td>PACK_SKIP_IMAGES</td><td>GLint</td></tr>
885 <tr><td>PACK_SKIP_PIXELS</td><td>GLint</td></tr>
886 <tr><td>PACK_SKIP_ROWS</td><td>GLint</td></tr>
887 <tr><td>PIXEL_PACK_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
888 <tr><td>PIXEL_UNPACK_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
889 <tr><td>PRIMITIVE_RESTART_FIXED_INDEX</td><td>GLboolean</td></tr>
890 <tr><td>RASTERIZER_DISCARD</td><td>GLboolean</td></tr>
891 <tr><td>READ_BUFFER</td><td>GLenum</td></tr>
892 <tr><td>READ_FRAMEBUFFER_BINDING</td><td>WebGLFramebuffer</td></tr>
893 <tr><td>SAMPLE_ALPHA_TO_COVERAGE</td><td>GLboolean</td></tr>
894 <tr><td>SAMPLE_COVERAGE</td><td>GLboolean</td></tr>
895 <tr><td>SAMPLER_BINDING</td><td>WebGLSampler</td></tr>
896 <tr><td>TEXTURE_BINDING_2D_ARRAY</td><td>WebGLTexture</td></tr>
897 <tr><td>TEXTURE_BINDING_3D</td><td>WebGLTexture</td></tr>
898 <tr><td>TRANSFORM_FEEDBACK_ACTIVE</td><td>GLboolean</td></tr>
899 <tr><td>TRANSFORM_FEEDBACK_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
900 <tr><td>TRANSFORM_FEEDBACK_PAUSED</td><td>GLboolean</td></tr>
901 <tr><td>UNIFORM_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
902 <tr><td>UNIFORM_BUFFER_OFFSET_ALIGNMENT</td><td>GLint</td></tr>
903 <tr><td>UNPACK_IMAGE_HEIGHT</td><td>GLint</td></tr>
904 <tr><td>UNPACK_ROW_LENGTH</td><td>GLint</td></tr>
905 <tr><td>UNPACK_SKIP_IMAGES</td><td>GLboolean</td></tr>
906 <tr><td>UNPACK_SKIP_PIXELS</td><td>GLboolean</td></tr>
907 <tr><td>UNPACK_SKIP_ROWS</td><td>GLboolean</td></tr>
908 <tr><td>VERTEX_ARRAY_BINDING</td><td>WebGLVertexArrayObject</td></tr>
911 <dt class="idl-code">any getIndexedParameter(GLenum target, GLuint index)
912 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.1">OpenGL ES 3.0.3 §6.1.1</a>,
913 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGet.xhtml">glGet OpenGL ES 3.0 man page</a>)</span>
915 Return the indexed value for the passed <code class="param">target</code>. The type returned is the natural type for the requested <code class="param">pname</code>,
916 as given in the following table:
918 <tr><th>target</th><th>returned type</th></tr>
919 <tr><td>TRANSFORM_FEEDBACK_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
920 <tr><td>TRANSFORM_FEEDBACK_BUFFER_SIZE</td><td>GLsizeiptr</td></tr>
921 <tr><td>TRANSFORM_FEEDBACK_BUFFER_START</td><td>GLintptr</td></tr>
922 <tr><td>UNIFORM_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
923 <tr><td>UNIFORM_BUFFER_SIZE</td><td>GLsizeiptr</td></tr>
924 <tr><td>UNIFORM_BUFFER_START</td><td>GLintptr</td></tr>
926 <p>If <code class="param">target</code> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
927 <p>If <code class="param">index</code> is outside of the valid range for the indexed state <code class="param">target</code>, generates an <code>INVALID_VALUE</code> error.</p>
928 <p>If an OpenGL error is generated, returns null.</p>
929 <dt class="idl-code"><a name="ISENABLED">GLboolean isEnabled</a>(GLenum cap)
930 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.1">OpenGL ES 3.0.3 §6.1.1</a>,
931 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glIsEnabled.xhtml">OpenGL ES 3.0 man page</a>)</span>
933 In addition to all of the <code class="param">cap</code> values from WebGL 1.0, PRIMITIVE_RESTART_FIXED_INDEX and RASTERIZER_DISCARD are supported.
936 <!-- ======================================================================================================= -->
938 <h4>Buffer objects</h4>
941 <dt class="idl-code">any getBufferParameter(GLenum target, GLenum pname)
942 <span class="gl-spec">
943 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.9">OpenGL ES 3.0.3 §6.1.9</a>,
944 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetBufferParameter.xhtml" class="nonnormative">man page</a>)
948 Return the value for the passed pname. In addition to supporting querying with the pname BUFFER_USAGE
949 as in WebGL 1.0, querying with the pname BUFFER_SIZE returns the buffer size as a value of type
953 <p class="idl-code">void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
954 <span class="gl-spec">
955 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.9.5">OpenGL ES 3.0.3 §2.9.5</a>,
956 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glCopyBufferSubData.xhtml" class="nonnormative">man page</a>)
961 <p class="idl-code">void getBufferSubData(GLenum target, GLintptr offset, GetBufferDataDest returnedData)
965 For the WebGLBuffer bound to the passed target, read <code>returnedData.byteLength</code>
966 bytes from the buffer starting at byte offset <code>offset</code> and write them
967 to <code>returnedData</code>. If <code>offset + returnedData.byteLength</code> would extend
968 beyond the end of the buffer an <code>INVALID_VALUE</code> error is generated.
969 If <code>returnedData</code> is null then an <code>INVALID_VALUE</code> error is generated.
970 If <code>offset</code> is less than zero, an <code>INVALID_VALUE</code> error is generated.
971 If zero is bound to <code>target</code>, an <code>INVALID_OPERATION</code> error is generated.
972 If any error is generated, no data is written to <code>returnedData</code>.
976 <!-- ======================================================================================================= -->
978 <h4>Framebuffer objects</h4>
981 <dt class="idl-code">any getFramebufferAttachmentParameter(GLenum target, GLenum attachment,
983 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.13">OpenGL ES 3.0.3 §6.1.13</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetFramebufferAttachmentParameteriv.xhtml">glGetFramebufferAttachmentParameteriv</a>)</span>
986 Return the value for the passed pname given the passed target and attachment. The type
987 returned is the natural type for the requested pname, as given in the following table:
989 <tr><th>pname</th><th>returned type</th></tr>
990 <tr><td>FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE</td><td>GLint</td></tr>
991 <tr><td>FRAMEBUFFER_ATTACHMENT_BLUE_SIZE</td><td>GLint</td></tr>
992 <tr><td>FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING</td><td>Genum</td></tr>
993 <tr><td>FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE</td><td>Genum</td></tr>
994 <tr><td>FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE</td><td>GLint</td></tr>
995 <tr><td>FRAMEBUFFER_ATTACHMENT_GREEN_SIZE</td><td>GLint</td></tr>
996 <tr><td>FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</td><td>WebGLRenderbuffer or WebGLTexture</td></tr>
997 <tr><td>FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</td><td>GLenum</td></tr>
998 <tr><td>FRAMEBUFFER_ATTACHMENT_RED_SIZE</td><td>GLint</td></tr>
999 <tr><td>FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE</td><td>GLint</td></tr>
1000 <tr><td>FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE</td><td>GLint</td></tr>
1001 <tr><td>FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER</td><td>Gint</td></tr>
1002 <tr><td>FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL</td><td>GLint</td></tr>
1004 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1005 <p>If an OpenGL error is generated, returns null.</p>
1008 <p class="idl-code">void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
1009 <span class="gl-spec">
1010 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-4.3.2">OpenGL ES 3.0.3 §4.3.2</a>,
1011 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBlitFramebuffer.xhtml" class="nonnormative">man page</a>)
1016 <p class="idl-code">void framebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
1017 <span class="gl-spec">
1018 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-4.4">OpenGL ES 3.0.3 §4.4</a>,
1019 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glFramebufferTextureLayer.xhtml" class="nonnormative">man page</a>)
1024 <p class="idl-code">any getInternalformatParameter(GLenum target, GLenum internalformat, GLenum pname)
1025 <span class="gl-spec">
1026 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.15">OpenGL ES 3.0.3 §6.1.15</a>,
1027 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetInternalformativ.xhtml" class="nonnormative">man page</a>)
1032 Return the value for the passed pname given the passed target and internalformat. The type
1033 returned is given in the following table:
1035 <tr><th>pname</th><th>returned type</th></tr>
1036 <tr><td>NUM_SAMPLE_COUNTS</td><td>GLint</td></tr>
1037 <tr><td>SAMPLES</td><td>Int32Array</td></tr>
1039 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1040 <p>If an OpenGL error is generated, returns null.</p>
1041 <p>Each query for SAMPLES returns a new typed array object instance.</p>
1044 <p class="idl-code">void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments)
1045 <span class="gl-spec">
1046 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-4.5">OpenGL ES 3.0.3 §4.5</a>,
1047 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glInvalidateFramebuffer.xhtml" class="nonnormative">man page</a>)
1052 <p class="idl-code">void invalidateSubFramebuffer (GLenum target, sequence<GLenum> attachments, GLint x, GLint y, GLsizei width, GLsizei height)
1053 <span class="gl-spec">
1054 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-4.5">OpenGL ES 3.0.3 §4.5</a>,
1055 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glInvalidateSubFramebuffer.xhtml" class="nonnormative">man page</a>)
1060 <p class="idl-code">void readBuffer(GLenum mode)
1061 <span class="gl-spec">
1062 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-4.3.1">OpenGL ES 3.0.3 §4.3.1</a>,
1063 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glReadBuffer.xhtml" class="nonnormative">man page</a>)
1069 <!-- ======================================================================================================= -->
1071 <h4>Renderbuffer objects</h4>
1073 <dl class="methods">
1074 <dt class="idl-code">any getRenderbufferParameter(GLenum target, GLenum pname)
1075 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.14">OpenGL ES 2.0 §6.1.14</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetRenderbufferParameteriv.xhtml">glGetRenderbufferParameteriv</a>)</span>
1078 Return the value for the passed pname given the passed target. The type returned is the natural
1079 type for the requested pname, as given in the following table:
1081 <tr><th>pname</th><th>returned type</th></tr>
1082 <tr><td>RENDERBUFFER_WIDTH</td><td>GLint</td></tr>
1083 <tr><td>RENDERBUFFER_HEIGHT</td><td>GLint</td></tr>
1084 <tr><td>RENDERBUFFER_INTERNAL_FORMAT</td><td>GLenum</td></tr>
1085 <tr><td>RENDERBUFFER_RED_SIZE</td><td>GLint</td></tr>
1086 <tr><td>RENDERBUFFER_GREEN_SIZE</td><td>GLint</td></tr>
1087 <tr><td>RENDERBUFFER_BLUE_SIZE</td><td>GLint</td></tr>
1088 <tr><td>RENDERBUFFER_ALPHA_SIZE</td><td>GLint</td></tr>
1089 <tr><td>RENDERBUFFER_DEPTH_SIZE</td><td>GLint</td></tr>
1090 <tr><td>RENDERBUFFER_SAMPLES</td><td>GLint</td></tr>
1091 <tr><td>RENDERBUFFER_STENCIL_SIZE</td><td>GLint</td></tr>
1093 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1094 <p>If an OpenGL error is generated, returns null.</p>
1097 <p class="idl-code">void renderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
1098 <span class="gl-spec">
1099 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-4.4.2">OpenGL ES 3.0.3 §4.4.2</a>,
1100 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glRenderbufferStorageMultisample.xhtml" class="nonnormative">man page</a>)
1106 <!-- ======================================================================================================= -->
1108 <h4>Texture objects</h4>
1110 <dl class="methods">
1111 <dt class="idl-code">any getTexParameter(GLenum target, GLenum pname)
1112 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.3">OpenGL ES 3.0.3 §6.1.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetTexParameter.xhtml">man page</a>)</span>
1115 Return the value for the passed pname given the passed target. The type returned is the natural type for the
1116 requested pname, as given in the following table:
1118 <tr><th>pname</th><th>returned type</th></tr>
1119 <tr><td>TEXTURE_BASE_LEVEL</td><td>GLint</td></tr>
1120 <tr><td>TEXTURE_COMPARE_FUNC</td><td>GLenum</td></tr>
1121 <tr><td>TEXTURE_COMPARE_MODE</td><td>GLenum</td></tr>
1122 <tr><td>TEXTURE_MAG_FILTER</td><td>GLenum</td></tr>
1123 <tr><td>TEXTURE_MAX_LEVEL</td><td>GLint</td></tr>
1124 <tr><td>TEXTURE_MAX_LOD</td><td>GLfloat</td></tr>
1125 <tr><td>TEXTURE_MIN_FILTER</td><td>GLenum</td></tr>
1126 <tr><td>TEXTURE_MIN_LOD</td><td>GLfloat</td></tr>
1127 <tr><td>TEXTURE_SWIZZLE_A</td><td>GLenum</td></tr>
1128 <tr><td>TEXTURE_SWIZZLE_B</td><td>GLenum</td></tr>
1129 <tr><td>TEXTURE_SWIZZLE_G</td><td>GLenum</td></tr>
1130 <tr><td>TEXTURE_SWIZZLE_R</td><td>GLenum</td></tr>
1131 <tr><td>TEXTURE_WRAP_R</td><td>GLenum</td></tr>
1132 <tr><td>TEXTURE_WRAP_S</td><td>GLenum</td></tr>
1133 <tr><td>TEXTURE_WRAP_T</td><td>GLenum</td></tr>
1135 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1136 <p>If an attempt is made to call this function with no WebGLTexture bound (see above), generates an
1137 <code>INVALID_OPERATION</code> error.</p>
1138 <p>If an OpenGL error is generated, returns null.</p>
1141 <p class="idl-code">void texStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
1142 <span class="gl-spec">
1143 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.4">OpenGL ES 3.0.3 §3.8.4</a>,
1144 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glTexStorage2D.xhtml" class="nonnormative">man page</a>)
1149 <p class="idl-code">void texStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
1150 <span class="gl-spec">
1151 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.4">OpenGL ES 3.0.3 §3.8.4</a>,
1152 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glTexStorage3D.xhtml" class="nonnormative">man page</a>)
1157 <p class="idl-code">void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, ArrayBufferView? pixels)
1158 <span class="gl-spec">
1159 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.5">OpenGL ES 3.0.3 §3.8.5</a>,
1160 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glTexSubImage3D.xhtml" class="nonnormative">man page</a>)
1165 <p class="idl-code">void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, TexImageSource? source)
1166 <span class="gl-spec">
1167 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.5">OpenGL ES 3.0.3 §3.8.5</a>,
1168 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glTexSubImage3D.xhtml" class="nonnormative">man page</a>)
1173 <p class="idl-code">void copyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
1174 <span class="gl-spec">
1175 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.5">OpenGL ES 3.0.3 §3.8.5</a>,
1176 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glCopyTexSubImage3D.xhtml" class="nonnormative">man page</a>)
1181 <p class="idl-code">void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, ArrayBufferView data)
1182 <span class="gl-spec">
1183 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.6">OpenGL ES 3.0.3 §3.8.6</a>,
1184 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glCompressedTexImage3D.xhtml" class="nonnormative">man page</a>)
1189 <p class="idl-code">void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, ArrayBufferView data)
1190 <span class="gl-spec">
1191 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.6">OpenGL ES 3.0.3 §3.8.6</a>,
1192 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glCompressedTexSubImage3D.xhtml" class="nonnormative">man page</a>)
1198 <!-- ======================================================================================================= -->
1200 <h4>Programs and Shaders</h4>
1202 <dl class="methods">
1204 <p class="idl-code">[WebGLHandlesContextLoss] GLint getFragDataLocation(WebGLProgram? program, DOMString name)
1205 <span class="gl-spec">
1206 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.9.2">OpenGL ES 3.0.3 §3.9.2</a>,
1207 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetFragDataLocation.xhtml" class="nonnormative">man page</a>)
1211 <dt class="idl-code">any getProgramParameter(WebGLProgram? program, GLenum pname)
1212 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.12">OpenGL ES 3.0.3 §6.1.12</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetProgramiv.xhtml">man page</a>)</span>
1215 Return the value for the passed pname given the passed program. The type returned is the natural
1216 type for the requested pname, as given in the following table:
1218 <tr><th>pname</th><th>returned type</th></tr>
1219 <tr><td>DELETE_STATUS</td><td>GLboolean</td></tr>
1220 <tr><td>LINK_STATUS</td><td>GLboolean</td></tr>
1221 <tr><td>VALIDATE_STATUS</td><td>GLboolean</td></tr>
1222 <tr><td>ATTACHED_SHADERS</td><td>GLint</td></tr>
1223 <tr><td>ACTIVE_ATTRIBUTES</td><td>GLint</td></tr>
1224 <tr><td>ACTIVE_UNIFORMS</td><td>GLint</td></tr>
1225 <tr><td>TRANSFORM_FEEDBACK_BUFFER_MODE</td><td>GLenum</td></tr>
1226 <tr><td>TRANSFORM_FEEDBACK_VARYINGS</td><td>GLint</td></tr>
1227 <tr><td>ACTIVE_UNIFORM_BLOCKS</td><td>GLint</td></tr>
1229 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error and returns null.</p>
1230 <p>Returns null if any OpenGL errors are generated during the execution of this
1235 <!-- ======================================================================================================= -->
1237 <h4>Uniforms and attributes</h4>
1239 <dl class="methods">
1240 <dt class="idl-code">
1241 any getUniform(WebGLProgram? program, WebGLUniformLocation? location)
1242 <span class="gl-spec">
1243 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.12">OpenGL ES 3.0.3 §6.1.12</a>,
1244 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniform.xhtml" class="nonnormative">man page</a>)
1248 Return the uniform value at the passed location in the passed program. The type returned is dependent
1249 on the uniform type. The types returned for the new uniform types in WebGL 2 are given in the
1252 <tr><th>uniform type</th><th>returned type</th></tr>
1253 <tr><td>uint</td><td>GLuint</td></tr>
1254 <tr><td>uvec2</td><td>Uint32Array (with 2 elements)</td></tr>
1255 <tr><td>uvec3</td><td>Uint32Array (with 3 elements)</td></tr>
1256 <tr><td>uvec4</td><td>Uint32Array (with 4 elements)</td></tr>
1257 <tr><td>mat2x3</td><td>Float32Array (with 6 elements)</td></tr>
1258 <tr><td>mat2x4</td><td>Float32Array (with 8 elements)</td></tr>
1259 <tr><td>mat3x2</td><td>Float32Array (with 6 elements)</td></tr>
1260 <tr><td>mat3x4</td><td>Float32Array (with 12 elements)</td></tr>
1261 <tr><td>mat4x2</td><td>Float32Array (with 8 elements)</td></tr>
1262 <tr><td>mat4x3</td><td>Float32Array (with 12 elements)</td></tr>
1263 <tr><td>any sampler type</td><td>GLint</td></tr>
1265 <p>The types returned for the uniform types shared with WebGL 1 are the same as in WebGL 1.</p>
1268 <p class="idl-code">void uniform[1234]ui(WebGLUniformLocation? location, ...)</p>
1269 <p class="idl-code">void uniform[1234]uiv(WebGLUniformLocation? location, ...)</p>
1270 <p class="idl-code">void uniformMatrix[234]x[234]fv(WebGLUniformLocation? location, ...)
1271 <span class="gl-spec">
1272 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.11.6">OpenGL ES 3.0.3 §2.11.6</a>,
1273 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml" class="nonnormative">man page</a>)
1278 Each of the uniform* functions above sets the specified uniform or uniforms to the values
1279 provided. If the passed <code>location</code> is not null and was not obtained from the
1280 currently used program via an earlier call to <code>getUniformLocation</code>,
1281 an <code>INVALID_OPERATION</code> error will be generated. If the passed
1282 <code>location</code> is null, the data passed in will be silently ignored and no uniform
1283 variables will be changed.
1285 If the array passed to any of the vector forms (those ending in <code>v</code>) has an
1286 invalid length, an <code>INVALID_VALUE</code> error will be generated. The length is invalid
1287 if it is too short for or is not an integer multiple of the assigned type.
1289 <dt><p class="idl-code">void vertexAttribI4[u]i(GLuint indx, ...)</p>
1290 <p class="idl-code">void vertexAttribI4[u]iv(GLuint indx, ...)
1291 <span class="gl-spec">
1292 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.7">OpenGL ES 3.0.3 §2.7</a>,
1293 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml" class="nonnormative">man page</a>)
1297 Sets the vertex attribute at the passed index to the given constant integer value. Values set via the
1298 <code>vertexAttrib</code> are guaranteed to be returned from the <code>getVertexAttrib</code> function
1299 with the <code>CURRENT_VERTEX_ATTRIB</code> param, even if there have been intervening calls to
1300 <code>drawArrays</code> or <code>drawElements</code>.
1303 <p class="idl-code">void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset)
1304 <span class="gl-spec">
1305 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.8">OpenGL ES 3.0.3 §2.8</a>,
1306 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttribPointer.xhtml" class="nonnormative">man page</a>)
1311 Assign the WebGLBuffer object currently bound to the ARRAY_BUFFER target to the vertex
1312 attribute at the passed index. Values are always left as integer values. Size is number of
1313 components per attribute. Stride and offset are in units of bytes. Passed stride and offset
1314 must be appropriate for the passed type and size or an <code>INVALID_OPERATION</code> error
1315 will be generated; see <a href="../1.0/#BUFFER_OFFSET_AND_STRIDE">Buffer Offset and Stride
1316 Requirements</a>. If offset is negative, an <code>INVALID_VALUE</code> error will be
1317 generated. If no WebGLBuffer is bound to the ARRAY_BUFFER target,
1318 an <code>INVALID_OPERATION</code> error will be generated. In WebGL, the maximum supported
1319 stride is 255; see <a href="../1.0/#VERTEX_STRIDE"> Vertex Attribute Data Stride</a>.
1321 <dt class="idl-code">any getVertexAttrib(GLuint index, GLenum pname)
1322 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.12">OpenGL ES 3.0.3 §6.1.12</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetVertexAttrib.xhtml">man page</a>)</span>
1325 Return the information requested in pname about the vertex attribute at the passed index. The
1326 type returned is dependent on the information requested, as shown in the following table:
1328 <tr><th>pname</th><th>returned type</th></tr>
1329 <tr><td>VERTEX_ATTRIB_ARRAY_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
1330 <tr><td>VERTEX_ATTRIB_ARRAY_ENABLED</td><td>GLboolean</td></tr>
1331 <tr><td>VERTEX_ATTRIB_ARRAY_SIZE</td><td>GLint</td></tr>
1332 <tr><td>VERTEX_ATTRIB_ARRAY_STRIDE</td><td>GLint</td></tr>
1333 <tr><td>VERTEX_ATTRIB_ARRAY_TYPE</td><td>GLenum</td></tr>
1334 <tr><td>VERTEX_ATTRIB_ARRAY_NORMALIZED</td><td>GLboolean</td></tr>
1335 <tr><td>CURRENT_VERTEX_ATTRIB</td><td>One of Float32Array, Int32Array or Uint32Array (each with 4 elements)</td></tr>
1336 <tr><td>VERTEX_ATTRIB_ARRAY_INTEGER</td><td>GLboolean</td></tr>
1337 <tr><td>VERTEX_ATTRIB_ARRAY_DIVISOR</td><td>GLint</td></tr>
1339 <p>For CURRENT_VERTEX_ATTRIB, the return type is dictated by the most recent call
1340 to the vertexAttrib family of functions for the given index. That is, if
1341 vertexAttribI4i* was used, the return type will be Int32Array; If vertexAttribI4ui*
1342 was used, the return type will be Uint32Array; Otherwise, Float32Array.
1344 <p>All queries returning sequences or typed arrays return a new object each time.</p>
1345 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1346 <p>If an OpenGL error is generated, returns null.</p>
1350 <!-- ======================================================================================================= -->
1352 <h4><a name="WRITING_TO_THE_DRAWING_BUFFER">Writing to the drawing buffer</a></h4>
1354 <dl class="methods">
1356 <p class="idl-code">void clear(GLbitfield mask)
1357 <span class="gl-spec">
1358 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-4.2.3">OpenGL ES 3.0.3 §4.2.3</a>,
1359 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glClear.xhtml" class="nonnormative">man page</a>)
1364 Clear buffers to preset values. If an integer color buffer is among the buffers that would be
1365 cleared, an <code>INVALID_OPERATION</code> error is generated and nothing is cleared.
1368 <p class="idl-code">void vertexAttribDivisor(GLuint index, GLuint divisor)
1369 <span class="gl-spec">
1370 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.8">OpenGL ES 3.0.3 §2.8</a>,
1371 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttribDivisor.xhtml" class="nonnormative">man page</a>)
1376 Set the rate at which the vertex attribute identified by <code>index</code> advances when drawing.
1379 <p class="idl-code">void drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
1380 <span class="gl-spec">
1381 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.8.3">OpenGL ES 3.0.3 §2.8.3</a>,
1382 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDrawArraysInstanced.xhtml" class="nonnormative">man page</a>)
1387 Draw <code>instanceCount</code> instances of geometry using the currently enabled vertex attributes.
1388 Vertex attributes which have a non-zero divisor advance once every divisor instances.
1391 <p class="idl-code">void drawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount)
1392 <span class="gl-spec">
1393 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.8.3">OpenGL ES 3.0.3 §2.8.3</a>,
1394 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDrawElementsInstanced.xhtml" class="nonnormative">man page</a>)
1399 Draw <code>instanceCount</code> instances of geometry using the currently bound element array buffer.
1400 Vertex attributes which have a non-zero divisor advance once every divisor instances.
1403 <p class="idl-code">void drawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLintptr offset)
1404 <span class="gl-spec">
1405 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.8.3">OpenGL ES 3.0.3 §2.8.3</a>,
1406 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDrawRangeElements.xhtml" class="nonnormative">man page</a>)
1411 Draw using the currently bound element array buffer. All error conditions specified for
1412 <code>drawElements</code> in the section <a href="../1.0/#WRITING_TO_THE_DRAWING_BUFFER">Writing
1413 to the drawing buffer</a> of the WebGL 1.0 specification apply. In addition, indices used to draw
1414 must lie between <code>start</code> and <code>end</code> inclusive. If the draw call references
1415 indices that are not within this range, an <code>INVALID_OPERATION</code> error is generated and
1416 nothing is drawn.<br><br>
1418 WebGL 2 performs additional error checking beyond that specified in OpenGL ES 3.0 during calls to
1419 <code>drawElements</code>, <code>drawArrays</code>, <code>drawRangeElements</code> and their
1420 instanced variants. See <a href="#RANGE_CHECKING">Range Checking</a>,
1421 <a href="#ENABLED_ATTRIBUTE">Enabled Attribute</a>, and <a href="#ACTIVE_UNIFORM_BLOCK_BACKING">Active
1422 Uniform Block Backing</a>.
1426 <!-- ======================================================================================================= -->
1428 <h4>Multiple render targets</h4>
1430 <dl class="methods">
1432 <p class="idl-code">void drawBuffers(sequence<GLenum> buffers)
1433 <span class="gl-spec">
1434 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-4.2.1">OpenGL ES 3.0.3 §4.2.1</a>,
1435 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDrawBuffers.xhtml" class="nonnormative">man page</a>)
1440 Define the draw buffers to which all fragment colors are written.
1443 <p class="idl-code">void clearBufferiv(GLenum buffer, GLint drawbuffer, ClearBufferISource value)</p>
1444 <p class="idl-code">void clearBufferuiv(GLenum buffer, GLint drawbuffer, ClearBufferUISource value)</p>
1445 <p class="idl-code">void clearBufferfv(GLenum buffer, GLint drawbuffer, ClearBufferFSource value)</p>
1446 <p class="idl-code">void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
1447 <span class="gl-spec">
1448 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-4.2.3">OpenGL ES 3.0.3 §4.2.3</a>,
1449 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glClearBuffer.xhtml" class="nonnormative">man page</a>)
1454 Set every pixel in the specified buffer to a constant value. The clearBuffer function that should be
1455 used for a color buffer depends on the type of the color buffer, given in the following table:
1457 <tr><th>Type of buffer</th><th>clearBuffer function</th></tr>
1458 <tr><td>floating point</td><td>clearBufferfv</td></tr>
1459 <tr><td>fixed point</td><td>clearBufferfv</td></tr>
1460 <tr><td>signed integer</td><td>clearBufferiv</td></tr>
1461 <tr><td>unsigned integer</td><td>clearBufferuiv</td></tr>
1463 If <code>buffer</code> is <code>COLOR_BUFFER</code> and the function is not chosen according to the
1464 above table, an <code>INVALID_OPERATION</code> error is generated and nothing is cleared.
1467 <!-- ======================================================================================================= -->
1469 <h4>Query objects</h4>
1471 <dl class="methods">
1473 <p class="idl-code">WebGLQuery? createQuery()
1474 <span class="gl-spec">
1475 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.13">OpenGL ES 3.0.3 §2.13</a>,
1476 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGenQueries.xhtml" class="nonnormative">man page</a>)
1481 <p class="idl-code">void deleteQuery(WebGLQuery? query)
1482 <span class="gl-spec">
1483 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.13">OpenGL ES 3.0.3 §2.13</a>,
1484 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteQueries.xhtml" class="nonnormative">man page</a>)
1489 <p class="idl-code">[WebGLHandlesContextLoss] GLboolean isQuery(WebGLQuery? query)
1490 <span class="gl-spec">
1491 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.7">OpenGL ES 3.0.3 §6.1.7</a>,
1492 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glIsQuery.xhtml" class="nonnormative">man page</a>)
1497 <p class="idl-code">void beginQuery(GLenum target, WebGLQuery? query)
1498 <span class="gl-spec">
1499 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.13">OpenGL ES 3.0.3 §2.13</a>,
1500 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBeginQuery.xhtml" class="nonnormative">man page</a>)
1505 <p class="idl-code">void endQuery(GLenum target)
1506 <span class="gl-spec">
1507 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.13">OpenGL ES 3.0.3 §2.13</a>,
1508 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBeginQuery.xhtml" class="nonnormative">man page</a>)
1513 <p class="idl-code">WebGLQuery? getQuery(GLenum target, GLenum pname)
1514 <span class="gl-spec">
1515 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.7">OpenGL ES 3.0.3 §6.1.7</a>,
1516 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetQueryiv.xhtml" class="nonnormative">man page</a>)
1521 <p>Returns information about a query target <em>target</em>, which must be one
1522 of <code>ANY_SAMPLES_PASSED</code> or <code>ANY_SAMPLES_PASSED_CONSERVATIVE</code> for
1523 occlusion queries, or <code>TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</code> for primitive
1524 queries. <em>pname</em> specifies the symbolic name of a query object target
1525 parameter. Currently it must be <code>CURRENT_QUERY</code>, and returns either the
1526 currently active query for the target, or null.</p>
1528 <p>If <em>target</em> or <em>pname</em> are not in the list above, generates
1529 an <code>INVALID_ENUM</code> error and returns null.</p>
1531 <p>Returns null if any OpenGL errors are generated during the execution of this
1535 <p class="idl-code">any getQueryParameter(WebGLQuery? query, GLenum pname)
1536 <span class="gl-spec">
1537 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.7">OpenGL ES 3.0.3 §6.1.7</a>,
1538 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetQueryObjectuiv.xhtml" class="nonnormative">man page</a>)
1543 <p>Returns a parameter <em>pname</em> of a query object. <code>QUERY_RESULT</code> returns
1544 the value of the query object's passed samples counter.
1545 <code>QUERY_RESULT_AVAILABLE</code> returns whether the samples counter is immediately
1546 available. The type returned is the natural type for the requested pname, as given in the
1547 following table:</p>
1549 <tr><th>pname</th><th>returned type</th></tr>
1550 <tr><td>QUERY_RESULT</td><td>GLuint</td></tr>
1551 <tr><td>QUERY_RESULT_AVAILABLE</td><td>GLboolean</td></tr>
1554 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code>
1555 error and returns null.</p>
1557 <p>if <em>query</em> is not a valid query object, or is a currently active query object,
1558 generates an <code>INVALID_OPERATION</code> error and returns null.
1560 <p>Returns null if any OpenGL errors are generated during the execution of this
1565 <!-- ======================================================================================================= -->
1567 <h4>Sampler objects</h4>
1569 <dl class="methods">
1571 <p class="idl-code">WebGLSampler? createSampler()
1572 <span class="gl-spec">
1573 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.2">OpenGL ES 3.0.3 §3.8.2</a>,
1574 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGenSamplers.xhtml" class="nonnormative">man page</a>)
1579 <p class="idl-code">void deleteSampler(WebGLSampler? sampler)
1580 <span class="gl-spec">
1581 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.2">OpenGL ES 3.0.3 §3.8.2</a>,
1582 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteSamplers.xhtml" class="nonnormative">man page</a>)
1587 <p class="idl-code">[WebGLHandlesContextLoss] GLboolean isSampler(WebGLSampler? sampler)
1588 <span class="gl-spec">
1589 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.2">OpenGL ES 3.0.3 §3.8.2</a>,
1590 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glIsSampler.xhtml" class="nonnormative">man page</a>)
1595 <p class="idl-code">void bindSampler(GLuint unit, WebGLSampler? sampler)
1596 <span class="gl-spec">
1597 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.2">OpenGL ES 3.0.3 §3.8.2</a>,
1598 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBindSampler.xhtml" class="nonnormative">man page</a>)
1603 <p class="idl-code">void samplerParameteri(WebGLSampler? sampler, GLenum pname, GLint param);</p>
1604 <p class="idl-code">void samplerParameteriv(WebGLSampler? sampler, GLenum pname, SamplerParameterIVSource param)</p>
1605 <p class="idl-code">void samplerParameterf(WebGLSampler? sampler, GLenum pname, GLfloat param);</p>
1606 <p class="idl-code">void samplerParameterfv(WebGLSampler? sampler, GLenum pname, SamplerParameterFVSource param)
1607 <span class="gl-spec">
1608 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8.2">OpenGL ES 3.0.3 §3.8.2</a>,
1609 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glSamplerParameter.xhtml" class="nonnormative">man page</a>)
1613 <dt class="idl-code">any getSamplerParameter(WebGLSampler? sampler, GLenum pname)
1614 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.5">OpenGL ES 3.0.3 §6.1.5</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetSamplerParameter.xhtml">man page</a>)</span>
1617 Return the information requested in pname about the given WebGLSampler, passed as <em>sampler</em>. The
1618 type returned is dependent on the information requested, as shown in the following table:
1620 <tr><th>pname</th><th>returned type</th></tr>
1621 <tr><td>TEXTURE_COMPARE_FUNC</td><td>GLenum</td></tr>
1622 <tr><td>TEXTURE_COMPARE_MODE</td><td>GLenum</td></tr>
1623 <tr><td>TEXTURE_MAG_FILTER</td><td>GLenum</td></tr>
1624 <tr><td>TEXTURE_MAX_LOD</td><td>GLfloat</td></tr>
1625 <tr><td>TEXTURE_MIN_FILTER</td><td>GLenum</td></tr>
1626 <tr><td>TEXTURE_MIN_LOD</td><td>GLfloat</td></tr>
1627 <tr><td>TEXTURE_WRAP_R</td><td>GLenum</td></tr>
1628 <tr><td>TEXTURE_WRAP_S</td><td>GLenum</td></tr>
1629 <tr><td>TEXTURE_WRAP_T</td><td>GLenum</td></tr>
1631 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1632 <p>If an OpenGL error is generated, returns null.</p>
1636 <!-- ======================================================================================================= -->
1638 <h4>Sync objects</h4>
1640 <dl class="methods">
1642 <p class="idl-code">WebGLSync? fenceSync(GLenum condition, GLbitfield flags)
1643 <span class="gl-spec">
1644 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-5.2">OpenGL ES 3.0.3 §5.2</a>,
1645 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBindSampler.xhtml" class="nonnormative">man page</a>)
1650 <p class="idl-code">[WebGLHandlesContextLoss] GLboolean isSync(WebGLSync? sync)
1651 <span class="gl-spec">
1652 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.8">OpenGL ES 3.0.3 §6.1.8</a>,
1653 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glIsSync.xhtml" class="nonnormative">man page</a>)
1658 <p class="idl-code">void deleteSync(WebGLSync? sync)
1659 <span class="gl-spec">
1660 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-5.2">OpenGL ES 3.0.3 §5.2</a>,
1661 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteSync.xhtml" class="nonnormative">man page</a>)
1666 <p class="idl-code">GLenum clientWaitSync(WebGLSync? sync, GLbitfield flags, GLuint64 timeout)
1667 <span class="gl-spec">
1668 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-5.2.1">OpenGL ES 3.0.3 §5.2.1</a>,
1669 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glClientWaitSync.xhtml" class="nonnormative">man page</a>)
1674 <p class="idl-code">void waitSync(WebGLSync? sync, GLbitfield flags, GLuint64 timeout)
1675 <span class="gl-spec">
1676 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-5.2.1">OpenGL ES 3.0.3 §5.2.1</a>,
1677 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glWaitSync.xhtml" class="nonnormative">man page</a>)
1681 <dt class="idl-code">any getSyncParameter(WebGLSync? sync, GLenum pname)
1682 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.8">OpenGL ES 3.0.3 §6.1.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetSynciv.xhtml">man page</a>)</span>
1685 Return the value for the passed pname given the passed WebGLSync object. The type returned is the natural
1686 type for the requested pname, as given in the following table:
1688 <tr><th>pname</th><th>returned type</th></tr>
1689 <tr><td>OBJECT_TYPE</td><td>GLenum</td></tr>
1690 <tr><td>SYNC_STATUS</td><td>GLenum</td></tr>
1691 <tr><td>SYNC_CONDITION</td><td>GLenum</td></tr>
1692 <tr><td>SYNC_FLAGS</td><td>GLbitfield</td></tr>
1694 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error and returns null.</p>
1695 <p>Returns null if any OpenGL errors are generated during the execution of this
1700 <!-- ======================================================================================================= -->
1702 <h4>Transform feedback</h4>
1705 Transform feedback mode captures the values of output variables written by the vertex shader. The
1706 vertices are captured before flatshading and clipping. The transformed vertices may be optionally
1707 discarded after being stored into one or more buffer objects, or they can be passed on down to the
1708 clipping stage for further processing. The set of output variables captured is determined when a
1712 <dl class="methods">
1713 <dt class="idl-code">WebGLTransformFeedback? createTransformFeedback()
1714 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.14.1">OpenGL ES 3.0.3 §2.14.1</a>,
1715 similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGenTransformFeedbacks.xhtml">glGenTransformFeedbacks</a>)</span>
1717 Create a <code class="interface">WebGLTransformFeedback</code> object and initialize it with a transform feedback object name as if by
1718 calling glGenTransformFeedbacks.
1720 <dt class="idl-code">void deleteTransformFeedback(WebGLTransformFeedback? transformFeedback)
1721 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.14.1">OpenGL ES 3.0.3 §2.14.1</a>,
1722 similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteTransformFeedbacks.xhtml">glDeleteTransformFeedbacks</a>)</span>
1724 Delete the transform feedback object contained in the passed <code class="interface">WebGLTransformFeedback</code> as if by calling
1725 glDeleteTransformFeedbacks. If the transform feedback has already been deleted the call has no effect.
1726 Note that the transform feedback object will be deleted when the <code class="interface">WebGLTransformFeedback</code> object is destroyed.
1727 This method merely gives the author greater control over when the vertex array object is destroyed.
1729 <dt class="idl-code">[WebGLHandlesContextLoss] GLboolean isTransformFeedback(WebGLTransformFeedback? transformFeedback)
1730 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.11">OpenGL ES 3.0.3 §6.1.11</a>,
1731 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glIsTransformFeedback.xhtml">man page</a>)</span>
1733 Return true if the passed <code class="interface">WebGLTransformFeedback</code> is valid and false otherwise. <br><br>
1735 Returns false if the transform feedback's <a href="#webgl-object-invalidated-flag">invalidated
1738 <dt class="idl-code">void bindTransformFeedback (GLenum target, WebGLTransformFeedback? transformFeedback)
1739 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.14.1">OpenGL ES 3.0.3 §2.14.1</a>,
1740 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBindTransformFeedback.xhtml">man page</a>)</span>
1742 Bind the given <code class="interface">WebGLTransformFeedback</code> object.
1743 If <code class="param">transformFeedback</code> is null, the default transform feedback object provided by the context
1746 <dt class="idl-code">void beginTransformFeedback(GLenum primitiveMode)
1747 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.14.2">OpenGL ES 3.0.3 §2.14.2</a>,
1748 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBeginTransformFeedback.xhtml">man page</a>)</span>
1751 <dt class="idl-code">void endTransformFeedback()
1752 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.14.2">OpenGL ES 3.0.3 §2.14.2</a>,
1753 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBeginTransformFeedback.xhtml">man page</a>)</span>
1756 <dt class="idl-code">void pauseTransformFeedback()
1757 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.14.2">OpenGL ES 3.0.3 §2.14.2</a>,
1758 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glPauseTransformFeedback.xhtml">man page</a>)</span>
1761 <dt class="idl-code">void resumeTransformFeedback()
1762 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.14.2">OpenGL ES 3.0.3 §2.14.2</a>,
1763 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glResumeTransformFeedback.xhtml">man page</a>)</span>
1766 <dt class="idl-code">void transformFeedbackVaryings(WebGLProgram? program, sequence<DOMString> varyings, GLenum bufferMode)
1767 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.11.8">OpenGL ES 3.0.3 §2.11.8</a>,
1768 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glTransformFeedbackVaryings.xhtml">man page</a>)</span>
1771 <dt class="idl-code">WebGLActiveInfo? getTransformFeedbackVarying(WebGLProgram? program, GLuint index)
1772 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.11.8">OpenGL ES 3.0.3 §2.11.8</a>,
1773 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetTransformFeedbackVarying.xhtml">man page</a>)</span>
1777 <!-- ======================================================================================================= -->
1779 <h4>Uniform Buffer objects</h4>
1782 Uniform buffer objects provide the storage for named uniform blocks, so the values of active uniforms
1783 in named uniform blocks may be changed by modifying the contents of the buffer object.
1786 <dl class="methods">
1787 <dt class="idl-code">void bindBufferBase(GLenum target, GLuint index, WebGLBuffer? buffer)
1788 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.9.1">OpenGL ES 3.0.3 §2.9.1</a>,
1789 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBindBufferBase.xhtml">man page</a>)</span>
1791 Binds the given <code class="interface">WebGLBuffer</code> object to the binding point at <code class="param">index</code> of the array of targets
1792 specified by <code class="param">target</code>.
1794 <dt class="idl-code">void bindBufferRange(GLenum target, GLuint index, WebGLBuffer? buffer, GLintptr offset, GLsizeiptr size)
1795 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.9.1">OpenGL ES 3.0.3 §2.9.1</a>,
1796 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBindBufferRange.xhtml">man page</a>)</span>
1798 Binds a range of the <code class="interface">WebGLBuffer</code> object buffer represented by <code class="param">offset</code> and <code class="param">size</code>
1799 to the binding point at <code class="param">index</code> of the array of targets specified by <code class="param">target</code>
1801 <dt class="idl-code">sequence<GLuint>? getUniformIndices(WebGLProgram? program, sequence<DOMString> uniformNames)
1802 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.11.6">OpenGL ES 3.0.3 §2.11.6</a>,
1803 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniformIndices.xhtml">man page</a>)</span>
1805 Retrieves the indices of a number of uniforms within <code class="param">program</code>.
1807 <dt class="idl-code">sequence<GLint>? getActiveUniforms(WebGLProgram? program, sequence<GLuint> uniformIndices, GLenum pname)
1808 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.11.6">OpenGL ES 3.0.3 §2.11.6</a>,
1809 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniformsiv.xhtml">man page</a>)</span>
1811 Queries the value of the parameter named <code class="param">pname</code> for each of the uniforms within <code class="param">program</code> whose indices
1812 are specified in the array of <code class="param">uniformIndices</code>.
1814 <dt class="idl-code">GLuint getUniformBlockIndex(WebGLProgram? program, DOMString uniformBlockName)
1815 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.11.6">OpenGL ES 3.0.3 §2.11.6</a>,
1816 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniformBlockIndex.xhtml">man page</a>)</span>
1818 Retrieves the index of a uniform block within <code class="param">program</code>.
1820 <dt class="idl-code">any getActiveUniformBlockParameter(WebGLProgram? program, GLuint uniformBlockIndex, GLenum pname)
1821 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.11.6">OpenGL ES 3.0.3 §2.11.6</a>,
1822 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniformBlockiv.xhtml">man page</a>)</span>
1824 Retrieves information about an active uniform block within <code class="param">program</code>. The type returned is the natural type for the requested
1825 <code class="param">pname</code>, as given in the following table:
1827 <tr><th>pname</th><th>returned type</th></tr>
1828 <tr><td>UNIFORM_BLOCK_BINDING</td><td>GLuint</td></tr>
1829 <tr><td>UNIFORM_BLOCK_DATA_SIZE</td><td>GLuint</td></tr>
1830 <tr><td>UNIFORM_BLOCK_ACTIVE_UNIFORMS</td><td>GLuint</td></tr>
1831 <tr><td>UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES</td><td>Uint32Array</td></tr>
1832 <tr><td>UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER</td><td>GLboolean</td></tr>
1833 <tr><td>UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER</td><td>GLboolean</td></tr>
1835 <p>If <code class="param">pname</code> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1836 <p>If <code class="param">uniformBlockIndex</code> is not an active block uniform for <code class="param">program</code> or greater than or equal to the
1837 value of <code>ACTIVE_UNIFORM_BLOCKS</code>, generates an <code>INVALID_VALUE</code> error.</p>
1838 <p>If an OpenGL error is generated, returns null.</p>
1840 <dt class="idl-code">DOMString? getActiveUniformBlockName(WebGLProgram? program, GLuint uniformBlockIndex)
1841 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.11.6">OpenGL ES 3.0.3 §2.11.6</a>,
1842 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniformBlockName.xhtml">man page</a>)</span>
1844 Retrieves the name of the active uniform block at <code class="param">uniformBlockIndex</code> within <code class="param">program</code>.
1846 <dt class="idl-code">void uniformBlockBinding(WebGLProgram? program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
1847 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.11.6">OpenGL ES 3.0.3 §2.11.6</a>,
1848 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glUniformBlockBinding.xhtml">man page</a>)</span>
1850 Assigns binding points for active uniform blocks.
1853 <!-- ======================================================================================================= -->
1855 <h4>Vertex Array objects</h4>
1858 Vertex Array objects (sometimes referred to as VAOs) encapsulate all state related to the
1859 definition of data used by the vertex processor.
1862 <dl class="methods">
1863 <dt class="idl-code">void bindVertexArray(WebGLVertexArrayObject? vertexArray)
1864 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.10">OpenGL ES 3.0.3 §2.10</a>,
1865 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBindVertexArray.xhtml">man page</a>)</span>
1867 Bind the given <code class="interface">WebGLVertexArrayObject</code> object.
1868 If <code class="param">vertexArray</code> is null, the default vertex array provided by the context
1871 <dt class="idl-code">WebGLVertexArrayObject? createVertexArray()
1872 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.10">OpenGL ES 3.0.3 §2.10</a>,
1873 similar to <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGenVertexArrays.xhtml">glGenVertexArrays</a>)</span>
1875 Create a <code class="interface">WebGLVertexArrayObject</code> object and initialize it with a vertex array object name as if by
1876 calling glGenVertexArrays.
1878 <dt class="idl-code">void deleteVertexArray(WebGLVertexArrayObject? vertexArray)
1879 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.10">OpenGL ES 3.0.3 §2.10</a>,
1880 similar to <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteVertexArrays.xhtml">glDeleteVertexArrays</a>)</span>
1882 Delete the vertex array object contained in the passed <code class="interface">WebGLVertexArrayObject</code> as if by calling
1883 glDeleteVertexArrays. If the vertex array has already been deleted the call has no effect.
1884 Note that the vertex array object will be deleted when the <code class="interface">WebGLVertexArrayObject</code> object is destroyed.
1885 This method merely gives the author greater control over when the vertex array object is
1888 <dt class="idl-code">[WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray)
1889 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-6.1.10">OpenGL ES 3.0.3 §6.1.10</a>,
1890 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glIsVertexArray.xhtml">man page</a>)</span>
1892 Return true if the passed <code class="interface">WebGLVertexArrayObject</code> is valid and false otherwise. <br><br>
1894 Returns false if the vertex array's <a href="#webgl-object-invalidated-flag">invalidated
1898 <!-- ======================================================================================================= -->
1900 <h2><a name="webgl_1_2_differences">Other differences Between WebGL 2.0 and WebGL 1.0</a></h2>
1902 <div class="note editor">
1903 Needs update for WebGL 2.0
1906 <h3>New Features Supported in the WebGL 2 API</h3>
1909 <li>ETC2 and EAC Compressed texture formats <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=appendix-c">OpenGL ES 3.0.3 Appendix C</a>)</span></li>
1910 <li>Primitive restart <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.8.1">OpenGL ES 3.0.3 §2.8.1</a>)</span></li>
1911 <li>Rasterizer discard <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.1">OpenGL ES 3.0.3 §3.1</a>)</span></li>
1914 <h3>Vertex Attribute Divisor</h3>
1917 In the WebGL 2 API, vertex attributes which have a non-zero divisor do not advance during calls to
1918 <code>drawArrays</code> and <code>drawElements</code>.
1919 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-2.8.3">OpenGL ES 3.0.3 §2.8.3</a>)</span>
1922 <!-- ======================================================================================================= -->
1924 <h2><a name="webgl_gl_differences">Differences Between WebGL and OpenGL ES 3.0</a></h2>
1926 <div class="note editor">
1927 Needs update for WebGL 2.0
1931 This section describes changes made to the WebGL API relative to the
1932 OpenGL ES 3.0 API to improve portability across various operating
1933 systems and devices.
1936 <h3><a name="BUFFER_OBJECT_BINDING">Buffer Object Binding</a></h3>
1939 In the WebGL 2 API, a given buffer object may not be bound both to <code>ELEMENT_ARRAY_BUFFER</code>
1940 and some other buffer binding point in its lifetime. This restriction implies that a given buffer
1941 object may contain either indices or other data, but not both.
1945 The type of a WebGLBuffer is initialized the first time it is passed as an argument to
1946 <code>bindBuffer</code>, <code>bindBufferRange</code> or <code>bindBufferBase</code>. A subsequent
1947 call to one of these functions which attempts to bind a WebGLBuffer that has been bound to
1948 <code>ELEMENT_ARRAY_BUFFER</code> to another binding point, or bind a WebGLBuffer which has been
1949 bound to another binding point to <code>ELEMENT_ARRAY_BUFFER</code> will generate an
1950 <code>INVALID_OPERATION</code> error, and the state of the binding point will remain untouched.
1954 These restrictions are similar to <a href="../1.0/#BUFFER_OBJECT_BINDING">buffer object binding
1955 restrictions in the WebGL 1 specification</a>.
1958 <h3>Draw buffers</h3>
1961 The value of the MAX_COLOR_ATTACHMENTS parameter must be equal to that of the MAX_DRAW_BUFFERS
1965 <h3>No Program Binaries</h3>
1968 Accessing binary representations of compiled shader programs is not supported in the WebGL 2 API.
1969 This includes OpenGL ES 3.0 <code>GetProgramBinary</code>, <code>ProgramBinary</code>, and
1970 <code>ProgramParameteri</code> entry points. In addition, querying the program binary length with
1971 <code>getProgramParameter</code>, and querying program binary formats with <code>getParameter</code>
1972 are not supported in the WebGL 2 API.
1975 <h3><a name="RANGE_CHECKING">Range Checking</a></h3>
1978 In addition to the range checking specified in the WebGL 1.0 specification section
1979 <a href="../1.0/#ATTRIBS_AND_RANGE_CHECKING">Enabled Vertex Attributes and Range Checking</a>,
1980 indices referenced by <code>drawElements</code>, <code>drawRangeElements</code> or
1981 <code>drawElementsInstanced</code> that are greater than the <code>MAX_ELEMENT_INDEX</code> parameter
1982 cause the draw call to generate an <code>INVALID_OPERATION</code> error even if they lie within the
1983 storage of the bound buffer. Range checking is not performed for indices that trigger primitive
1984 restart if primitive restart is enabled. The range checking specified for <code>drawArrays</code> in
1985 the WebGL 1.0 API is also applied to <code>drawArraysInstanced</code> in the WebGL 2.0 API.
1988 <h3><a name="ENABLED_ATTRIBUTE">Enabled Attribute</a></h3>
1991 In the WebGL 2 API, attempting to draw with <code>drawArrays</code>, <code>drawElements</code>,
1992 <code>drawRangeElements</code> or their instanced variants generates an <code>INVALID_OPERATION</code>
1993 error if there is not at least one enabled vertex attribute array that has a divisor of zero and is
1994 bound to an active generic attribute value in the program used for the draw command.
1997 <h3><a name="ACTIVE_UNIFORM_BLOCK_BACKING">Active Uniform Block Backing</a></h3>
2000 In the WebGL 2 API, attempting to draw with <code>drawArrays</code>, <code>drawElements</code>,
2001 <code>drawRangeElements</code> or their instanced variants generates an <code>INVALID_OPERATION</code>
2002 error if any active uniform block in the program used for the draw command is not backed by a
2003 sufficiently large buffer object.
2006 <h3>Default Framebuffer</h3>
2009 WebGL always has a default framebuffer. The <code>FRAMEBUFFER_UNDEFINED</code> enumerant is removed
2010 from the WebGL 2 API.
2013 <h3><a name="STRING_LENGTH_QUERIES">String Length Queries</a></h3>
2016 In the WebGL 2 API, the enumerants <code>ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH</code>,
2017 <code>TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH</code>, <code>UNIFORM_BLOCK_NAME_LENGTH</code>, and
2018 <code>UNIFORM_NAME_LENGTH</code> are removed in addition to similar
2019 <a href="../1.0/#STRING_LENGTH_QUERIES">enumerants removed in the WebGL 1.0 API</a>.
2022 <h3>Invalid Clears</h3>
2025 In the WebGL 2 API, trying to perform a clear when there is a mismatch between the type of the
2026 specified clear value and the type of a buffer that is being cleared generates an
2027 <code>INVALID_OPERATION</code> error instead of producing undefined results.
2030 <!-- ======================================================================================================= -->
2034 <h3>Normative references</h3>
2036 <dt id="refsWEBGL10">[WEBGL10]</dt>
2037 <dd><cite><a href="http://www.khronos.org/registry/webgl/specs/1.0/">
2038 WebGL Specification 1.0.2</a></cite>,
2041 <dt id="refsGLES30">[GLES30]</dt>
2042 <dd><cite><a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf">
2043 OpenGL® ES Version 3.0.3</a></cite>,
2046 <dt id="refsGLES20GLSL">[GLES30GLSL]</dt>
2047 <dd><cite><a href="http://www.khronos.org/registry/gles/specs/3.0/GLSL_ES_Specification_3.00.4.pdf">
2048 The OpenGL® ES Shading Language Version 3.00</a></cite>,
2049 R. Simpson, March 2013.
2051 <dt id="refsREGISTRY">[REGISTRY]</dt>
2052 <dd><cite><a href="http://www.khronos.org/registry/webgl/extensions/">
2053 WebGL Extension Registry</a></cite>
2055 <dt id="refsRFC2119">[RFC2119]</dt>
2056 <dd><cite><a href="http://www.ietf.org/rfc/rfc2119.txt">
2057 Key words for use in RFCs to Indicate Requirement Levels</a></cite>,
2058 S. Bradner. IETF, March 1997.
2060 <dt id="refsWEBIDL">[WEBIDL]</dt>
2061 <dd><cite><a href="http://dev.w3.org/2006/webapi/WebIDL/">
2062 Web IDL: W3C Editor’s Draft</a></cite>,