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 <link rel="stylesheet" type="text/css" href="../../../resources/Khronos-WD.css" />
8 <script src="../../../resources/jquery-1.3.2.min.js" type="text/javascript"></script>
9 <script src="../../../resources/generateTOC.js" type="text/javascript"></script>
11 <body onload="generateTOC(document.getElementById('toc'))">
15 <a href="http://khronos.org/">
16 <img alt=Khronos height=60 src="../../../resources/KhronosGroup-3D.png" width=220>
22 <a href="http://webgl.org/">
23 <img alt=WebGL height=72 src="../../../resources/WebGL-Logo.png" width=156>
29 <h1>WebGL 2 Specification</h1>
30 <h2 class="no-toc">Editor's Draft 17 October 2014</h2>
34 <a href="https://www.khronos.org/registry/webgl/specs/latest/2.0/">
35 https://www.khronos.org/registry/webgl/specs/latest/2.0/
38 <a href="https://www.khronos.org/registry/webgl/specs/latest/2.0/webgl2.idl">
39 <b>WebIDL:</b> https://www.khronos.org/registry/webgl/specs/latest/2.0/webgl2.idl
44 <a href="https://www.khronos.org/registry/webgl/specs/latest/2.0/">
45 https://www.khronos.org/registry/webgl/specs/latest/2.0/
48 <a href="https://www.khronos.org/registry/webgl/specs/latest/2.0/webgl2.idl">
49 <b>WebIDL:</b> https://www.khronos.org/registry/webgl/specs/latest/2.0/webgl2.idl
54 <a href="https://www.khronos.org/registry/webgl/specs/1.0.2/">
55 https://www.khronos.org/registry/webgl/specs/1.0.2/
58 <a href="https://www.khronos.org/registry/webgl/specs/1.0.2/webgl.idl">
59 <b>WebIDL:</b> https://www.khronos.org/registry/webgl/specs/1.0.2/webgl.idl
64 <a href="mailto:dino@apple.com">Dean Jackson</a>
65 <a href="http://www.apple.com/">(Apple Inc.)</a>
69 <span style="font-size: x-small; font-style: oblique">Copyright © 2014 Khronos Group</span>
73 <h2 class="no-toc">Abstract</h2>
75 This is Version 2.0 of the WebGL Specification.
78 This specification describes an additional rendering context and support
80 <a href="http://www.w3.org/TR/html5/the-canvas-element.html"
81 title="HTML 5 Canvas Element">
82 HTML 5 <span class="prop-name">canvas</span> element <a href="#refsCANVAS">[CANVAS]</a>.
84 This context allows rendering using an API that conforms closely to the OpenGL ES 3.0 API.
87 This document should be read as an extension to the <a href="https://www.khronos.org/registry/webgl/specs/1.0.2/">
88 WebGL 1.0 specification</a>. It will only describe the differences from 1.0.</a>
90 <h2 class="no-toc">Status of this document</h2>
94 This document is an editor's draft. Do not cite this document as other than work in
95 progress. Public discussion of this specification is welcome on the
96 (<a href="https://www.khronos.org/webgl/public-mailing-list/archives/">archived</a>) WebGL
97 mailing list <a href="mailto:public_webgl@khronos.org">public_webgl@khronos.org</a> (see
98 <a href="http://www.khronos.org/webgl/public-mailing-list/">instructions</a>).
102 <h2 class="no-toc">Table of contents</h2>
105 <h2>Introduction</h2>
108 WebGL™ is an immediate mode 3D rendering API designed for the web. This is Version 2 of the
109 WebGL specification. It is derived from OpenGL® ES 3.0, and provides similar rendering
110 functionality, but in an HTML context.
114 WebGL 2 is not entirely backwards compatible with WebGL 1. Existing error-free content written
115 against the core WebGL 1 specification without extensions will often run in WebGL 2 without
116 modification, but this is not always the case. All exceptions to backwards compatibility are
117 recorded in the <a href="#BACKWARDS_INCOMPATIBILITY">Backwards Incompatibility</a> section.
118 To access the new behavior provided in this specification, the content explicitly requests
119 a new context (<a href="#CONTEXT_CREATION">details below</a>).
126 Many functions described in this document contain links to OpenGL ES
127 man pages. While every effort is made to make these pages match the
128 OpenGL ES 3.0 specification <a href="#refsGLES30">[GLES30]</a>,
129 they may contain errors. In the case of a contradiction, the OpenGL
130 ES 3.0 specification is the final authority.
134 The remaining sections of this document are intended to be read in conjunction
135 with the OpenGL ES 3.0 specification (3.0.3 at the time of this writing, available
136 from the <a href="http://www.khronos.org/registry/gles/">Khronos OpenGL ES API Registry</a>).
137 Unless otherwise specified, the behavior of each method is defined by the
138 OpenGL ES 3.0 specification. This specification may diverge from OpenGL ES 3.0
139 in order to ensure interoperability or security, often defining areas that
140 OpenGL ES 3.0 leaves implementation-defined. These differences are summarized in the
141 <a href="#webgl_gl_differences">Differences Between WebGL and OpenGL ES 3.0</a> section.
144 <!-- ======================================================================================================= -->
146 <h2>Context Creation and Drawing Buffer Presentation</h2>
149 Before using the WebGL API, the author must obtain a <code>WebGLRenderingContext</code>
150 object for a given HTMLCanvasElement <a href="#refsCANVAS">[CANVAS]</a> as described
151 below. This object is used to manage OpenGL state and render to the drawing buffer, which
152 must be created at the time of context creation.
155 <!-- ======================================================================================================= -->
157 <h3><a name="CONTEXT_CREATION">Context Creation</a></h3>
160 Each <code>WebGLRenderingContext</code> and <code>WebGL2RenderingContext</code> has an
161 associated <b><a name="context-canvas">canvas</a></b>, set upon creation, which is
162 a <em>canvas</em> <a href="#refsCANVAS">[CANVAS]</a>.
165 Each <code>WebGLRenderingContext</code> and <code>WebGL2RenderingContext</code> has <b><a name="context-creation-parameters">context
166 creation parameters</a></b>, set upon creation, in
167 a <a href="../1.0/#WEBGLCONTEXTATTRIBUTES"><code>WebGLContextAttributes</code></a> object.
170 Each <code>WebGLRenderingContext</code> and <code>WebGL2RenderingContext</code> has <b><a name="actual-context-parameters">actual
171 context parameters</a></b>, set each time the drawing buffer is created, in
172 a <a href="../1.0/#WEBGLCONTEXTATTRIBUTES"><code>WebGLContextAttributes</code></a> object.
175 Each <code>WebGLRenderingContext</code> and <code>WebGL2RenderingContext</code> has a <b><a name="webgl-context-lost-flag">webgl
176 context lost flag</a></b>, which is initially unset.
179 When the <code>getContext()</code> method of a <code>canvas</code> element is to return a
181 the <em>contextId</em> <code>webgl2</code> <a href="#refsCANVASCONTEXTS">[CANVASCONTEXTS]</a>,
182 the user agent must perform the following steps:
184 <ol class="nestedlist">
186 <li> Create a new <code>WebGL2RenderingContext</code> object, <em>context</em>.
188 <li> Let <em>context's</em> <a href="#context-canvas">canvas</a> be the canvas
189 the <code>getContext()</code> method is associated with.
191 <li> Create a new <code>WebGLContextAttributes</code> object, <em>contextAttributes</em>.
193 <li> If <code>getContext()</code> was invoked with a second argument, <em>options</em>, set
194 the attributes of <em>contextAttributes</em> from those specified in <em>options</em>.
196 <li> <a href="#create-a-drawing-buffer">Create a <em>drawing buffer</em></a> using the settings
197 specified in <em>contextAttributes</em>, and associate the <em>drawing buffer</em>
198 with <em>context</em>.
200 <li> If drawing buffer creation failed, perform the following steps:
202 <ol class="nestedlist">
204 <li> <a href="#fire-a-webgl-context-creation-error">Fire a WebGL context creation
205 error</a> at <em>canvas</em>.
207 <li> Return null and terminate these steps.
211 <li> Set the attributes of <em>contextAttributes</em> based on the properties of the newly
212 created drawing buffer.
214 <li> Set <em>context's</em> <a href="#context-creation-parameters">context creation
215 parameters</a> to <em>contextAttributes</em>.
217 <li> Return <em>context</em>.
222 <!-- ======================================================================================================= -->
224 <h2>DOM Interfaces</h2>
227 This section describes the interfaces and functionality added to the
228 DOM to support runtime access to the functionality described above.
231 <!-- ======================================================================================================= -->
236 The following types are introduced in WebGL 2.0.
239 typedef long long GLint64;
240 typedef unsigned long long GLuint64;
243 <!-- ======================================================================================================= -->
248 The <code>WebGLQuery</code> interface represents an OpenGL Query Object.
249 The underlying object is created as if by calling glGenQueries
250 <span class="gl-spec">
251 (<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>,
252 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGenQueries.xhtml">man page</a>)
254 made active as if by calling glBeginQuery
255 <span class="gl-spec">
256 (<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>,
257 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBeginQuery.xhtml">man page</a>)
259 concluded as if by calling glEndQuery
260 <span class="gl-spec">
261 (<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>,
262 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBeginQuery.xhtml">man page</a>)
264 and destroyed as if by calling glDeleteQueries
265 <span class="gl-spec">
266 (<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>,
267 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteQueries.xhtml">man page</a>)
270 <pre class="idl">interface <dfn id="WebGLQuery">WebGLQuery</dfn> : WebGLObject {
273 <!-- ======================================================================================================= -->
275 <h3>WebGLSampler</h3>
278 The <code>WebGLSampler</code> interface represents an OpenGL Sampler Object.
279 The underlying object is created as if by calling glGenSamplers
280 <span class="gl-spec">
281 (<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>,
282 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGenSamplers.xhtml">man page</a>)
284 bound as if by calling glBindSampler
285 <span class="gl-spec">
286 (<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>,
287 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBindSampler.xhtml">man page</a>)
289 and destroyed as if by calling glDeleteSamplers
290 <span class="gl-spec">
291 (<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>,
292 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteSamplers.xhtml">man page</a>)
295 <pre class="idl">interface <dfn id="WebGLSampler">WebGLSampler</dfn> : WebGLObject {
298 <!-- ======================================================================================================= -->
303 The <code>WebGLSync</code> interface represents an OpenGL Sync Object.
304 The underlying object is created as if by calling glFenceSync
305 <span class="gl-spec">
306 (<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>,
307 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glFenceSync.xhtml">man page</a>)
309 blocked on as if by calling glClientWaitSync
310 <span class="gl-spec">
311 (<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>,
312 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glClientWaitSync.xhtml">man page</a>)
314 waited on internal to GL as if by calling glWaitSync
315 <span class="gl-spec">
316 (<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>,
317 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glWaitSync.xhtml">man page</a>)
319 queried as if by calling glGetSynciv
320 <span class="gl-spec">
321 (<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>,
322 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGetSynciv.xhtml">man page</a>)
324 and destroyed as if by calling glDeleteSync
325 <span class="gl-spec">
326 (<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>,
327 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteSync.xhtml">man page</a>)
332 <pre class="idl">interface <dfn id="WebGLSync">WebGLSync</dfn> : WebGLObject {
335 <!-- ======================================================================================================= -->
337 <h3>WebGLTransformFeedback</h3>
340 The <code>WebGLTransformFeedback</code> interface represents an OpenGL Transform Feedback Object.
341 The underlying object is created as if by calling glGenTransformFeedbacks
342 <span class="gl-spec">
343 (<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>,
344 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGenTransformFeedbacks.xhtml">man page</a>)
346 bound as if by calling glBindTransformFeedback
347 <span class="gl-spec">
348 (<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>,
349 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBindTransformFeedback.xhtml">man page</a>)
351 and destroyed as if by calling glDeleteTransformFeedbacks
352 <span class="gl-spec">
353 (<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>,
354 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteTransformFeedbacks.xhtml">man page</a>)
357 <pre class="idl">interface <dfn id="WebGLTransformFeedback">WebGLTransformFeedback</dfn> : WebGLObject {
360 <!-- ======================================================================================================= -->
362 <h3>WebGLVertexArrayObject</h3>
365 The <code>WebGLVertexArrayObject</code> interface represents an OpenGL Vertex Array Object.
366 The underlying object is created as if by calling glGenVertexArrays
367 <span class="gl-spec">
368 (<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>,
369 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGenVertexArrays.xhtml">man page</a>)
371 bound as if by calling glBindVertexArray
372 <span class="gl-spec">
373 (<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>,
374 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBindVertexArray.xhtml">man page</a>)
376 and destroyed as if by calling glDeleteVertexArrays
377 <span class="gl-spec">
378 (<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>,
379 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteVertexArrays.xhtml">man page</a>)
382 <pre class="idl">interface <dfn id="WebGLVertexArrayObject">WebGLVertexArrayObject</dfn> : WebGLObject {
385 <!-- ======================================================================================================= -->
387 <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3>
390 The <code>WebGL2RenderingContext</code> represents the API allowing
391 OpenGL ES 3.0 style rendering into the canvas element.
396 interface <dfn id="WebGL2RenderingContextBase">WebGL2RenderingContextBase</dfn>
398 const GLenum READ_BUFFER = 0x0C02;
399 const GLenum UNPACK_ROW_LENGTH = 0x0CF2;
400 const GLenum UNPACK_SKIP_ROWS = 0x0CF3;
401 const GLenum UNPACK_SKIP_PIXELS = 0x0CF4;
402 const GLenum PACK_ROW_LENGTH = 0x0D02;
403 const GLenum PACK_SKIP_ROWS = 0x0D03;
404 const GLenum PACK_SKIP_PIXELS = 0x0D04;
405 const GLenum COLOR = 0x1800;
406 const GLenum DEPTH = 0x1801;
407 const GLenum STENCIL = 0x1802;
408 const GLenum RED = 0x1903;
409 const GLenum RGB8 = 0x8051;
410 const GLenum RGBA8 = 0x8058;
411 const GLenum RGB10_A2 = 0x8059;
412 const GLenum TEXTURE_BINDING_3D = 0x806A;
413 const GLenum UNPACK_SKIP_IMAGES = 0x806D;
414 const GLenum UNPACK_IMAGE_HEIGHT = 0x806E;
415 const GLenum TEXTURE_3D = 0x806F;
416 const GLenum TEXTURE_WRAP_R = 0x8072;
417 const GLenum MAX_3D_TEXTURE_SIZE = 0x8073;
418 const GLenum UNSIGNED_INT_2_10_10_10_REV = 0x8368;
419 const GLenum MAX_ELEMENTS_VERTICES = 0x80E8;
420 const GLenum MAX_ELEMENTS_INDICES = 0x80E9;
421 const GLenum TEXTURE_MIN_LOD = 0x813A;
422 const GLenum TEXTURE_MAX_LOD = 0x813B;
423 const GLenum TEXTURE_BASE_LEVEL = 0x813C;
424 const GLenum TEXTURE_MAX_LEVEL = 0x813D;
425 const GLenum MIN = 0x8007;
426 const GLenum MAX = 0x8008;
427 const GLenum DEPTH_COMPONENT24 = 0x81A6;
428 const GLenum MAX_TEXTURE_LOD_BIAS = 0x84FD;
429 const GLenum TEXTURE_COMPARE_MODE = 0x884C;
430 const GLenum TEXTURE_COMPARE_FUNC = 0x884D;
431 const GLenum CURRENT_QUERY = 0x8865;
432 const GLenum QUERY_RESULT = 0x8866;
433 const GLenum QUERY_RESULT_AVAILABLE = 0x8867;
434 const GLenum STREAM_READ = 0x88E1;
435 const GLenum STREAM_COPY = 0x88E2;
436 const GLenum STATIC_READ = 0x88E5;
437 const GLenum STATIC_COPY = 0x88E6;
438 const GLenum DYNAMIC_READ = 0x88E9;
439 const GLenum DYNAMIC_COPY = 0x88EA;
440 const GLenum MAX_DRAW_BUFFERS = 0x8824;
441 const GLenum DRAW_BUFFER0 = 0x8825;
442 const GLenum DRAW_BUFFER1 = 0x8826;
443 const GLenum DRAW_BUFFER2 = 0x8827;
444 const GLenum DRAW_BUFFER3 = 0x8828;
445 const GLenum DRAW_BUFFER4 = 0x8829;
446 const GLenum DRAW_BUFFER5 = 0x882A;
447 const GLenum DRAW_BUFFER6 = 0x882B;
448 const GLenum DRAW_BUFFER7 = 0x882C;
449 const GLenum DRAW_BUFFER8 = 0x882D;
450 const GLenum DRAW_BUFFER9 = 0x882E;
451 const GLenum DRAW_BUFFER10 = 0x882F;
452 const GLenum DRAW_BUFFER11 = 0x8830;
453 const GLenum DRAW_BUFFER12 = 0x8831;
454 const GLenum DRAW_BUFFER13 = 0x8832;
455 const GLenum DRAW_BUFFER14 = 0x8833;
456 const GLenum DRAW_BUFFER15 = 0x8834;
457 const GLenum MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49;
458 const GLenum MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A;
459 const GLenum SAMPLER_3D = 0x8B5F;
460 const GLenum SAMPLER_2D_SHADOW = 0x8B62;
461 const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B;
462 const GLenum PIXEL_PACK_BUFFER = 0x88EB;
463 const GLenum PIXEL_UNPACK_BUFFER = 0x88EC;
464 const GLenum PIXEL_PACK_BUFFER_BINDING = 0x88ED;
465 const GLenum PIXEL_UNPACK_BUFFER_BINDING = 0x88EF;
466 const GLenum FLOAT_MAT2x3 = 0x8B65;
467 const GLenum FLOAT_MAT2x4 = 0x8B66;
468 const GLenum FLOAT_MAT3x2 = 0x8B67;
469 const GLenum FLOAT_MAT3x4 = 0x8B68;
470 const GLenum FLOAT_MAT4x2 = 0x8B69;
471 const GLenum FLOAT_MAT4x3 = 0x8B6A;
472 const GLenum SRGB = 0x8C40;
473 const GLenum SRGB8 = 0x8C41;
474 const GLenum SRGB8_ALPHA8 = 0x8C43;
475 const GLenum COMPARE_REF_TO_TEXTURE = 0x884E;
476 const GLenum RGBA32F = 0x8814;
477 const GLenum RGB32F = 0x8815;
478 const GLenum RGBA16F = 0x881A;
479 const GLenum RGB16F = 0x881B;
480 const GLenum VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD;
481 const GLenum MAX_ARRAY_TEXTURE_LAYERS = 0x88FF;
482 const GLenum MIN_PROGRAM_TEXEL_OFFSET = 0x8904;
483 const GLenum MAX_PROGRAM_TEXEL_OFFSET = 0x8905;
484 const GLenum MAX_VARYING_COMPONENTS = 0x8B4B;
485 const GLenum TEXTURE_2D_ARRAY = 0x8C1A;
486 const GLenum TEXTURE_BINDING_2D_ARRAY = 0x8C1D;
487 const GLenum R11F_G11F_B10F = 0x8C3A;
488 const GLenum UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B;
489 const GLenum RGB9_E5 = 0x8C3D;
490 const GLenum UNSIGNED_INT_5_9_9_9_REV = 0x8C3E;
491 const GLenum TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F;
492 const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80;
493 const GLenum TRANSFORM_FEEDBACK_VARYINGS = 0x8C83;
494 const GLenum TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84;
495 const GLenum TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85;
496 const GLenum TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88;
497 const GLenum RASTERIZER_DISCARD = 0x8C89;
498 const GLenum MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
499 const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B;
500 const GLenum INTERLEAVED_ATTRIBS = 0x8C8C;
501 const GLenum SEPARATE_ATTRIBS = 0x8C8D;
502 const GLenum TRANSFORM_FEEDBACK_BUFFER = 0x8C8E;
503 const GLenum TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F;
504 const GLenum RGBA32UI = 0x8D70;
505 const GLenum RGB32UI = 0x8D71;
506 const GLenum RGBA16UI = 0x8D76;
507 const GLenum RGB16UI = 0x8D77;
508 const GLenum RGBA8UI = 0x8D7C;
509 const GLenum RGB8UI = 0x8D7D;
510 const GLenum RGBA32I = 0x8D82;
511 const GLenum RGB32I = 0x8D83;
512 const GLenum RGBA16I = 0x8D88;
513 const GLenum RGB16I = 0x8D89;
514 const GLenum RGBA8I = 0x8D8E;
515 const GLenum RGB8I = 0x8D8F;
516 const GLenum RED_INTEGER = 0x8D94;
517 const GLenum RGB_INTEGER = 0x8D98;
518 const GLenum RGBA_INTEGER = 0x8D99;
519 const GLenum SAMPLER_2D_ARRAY = 0x8DC1;
520 const GLenum SAMPLER_2D_ARRAY_SHADOW = 0x8DC4;
521 const GLenum SAMPLER_CUBE_SHADOW = 0x8DC5;
522 const GLenum UNSIGNED_INT_VEC2 = 0x8DC6;
523 const GLenum UNSIGNED_INT_VEC3 = 0x8DC7;
524 const GLenum UNSIGNED_INT_VEC4 = 0x8DC8;
525 const GLenum INT_SAMPLER_2D = 0x8DCA;
526 const GLenum INT_SAMPLER_3D = 0x8DCB;
527 const GLenum INT_SAMPLER_CUBE = 0x8DCC;
528 const GLenum INT_SAMPLER_2D_ARRAY = 0x8DCF;
529 const GLenum UNSIGNED_INT_SAMPLER_2D = 0x8DD2;
530 const GLenum UNSIGNED_INT_SAMPLER_3D = 0x8DD3;
531 const GLenum UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4;
532 const GLenum UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7;
533 const GLenum DEPTH_COMPONENT32F = 0x8CAC;
534 const GLenum DEPTH32F_STENCIL8 = 0x8CAD;
535 const GLenum FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD;
536 const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210;
537 const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211;
538 const GLenum FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212;
539 const GLenum FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213;
540 const GLenum FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214;
541 const GLenum FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215;
542 const GLenum FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216;
543 const GLenum FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217;
544 const GLenum FRAMEBUFFER_DEFAULT = 0x8218;
545 const GLenum DEPTH_STENCIL_ATTACHMENT = 0x821A;
546 const GLenum DEPTH_STENCIL = 0x84F9;
547 const GLenum UNSIGNED_INT_24_8 = 0x84FA;
548 const GLenum DEPTH24_STENCIL8 = 0x88F0;
549 const GLenum UNSIGNED_NORMALIZED = 0x8C17;
550 const GLenum DRAW_FRAMEBUFFER_BINDING = 0x8CA6; /* Same as FRAMEBUFFER_BINDING */
551 const GLenum READ_FRAMEBUFFER = 0x8CA8;
552 const GLenum DRAW_FRAMEBUFFER = 0x8CA9;
553 const GLenum READ_FRAMEBUFFER_BINDING = 0x8CAA;
554 const GLenum RENDERBUFFER_SAMPLES = 0x8CAB;
555 const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4;
556 const GLenum MAX_COLOR_ATTACHMENTS = 0x8CDF;
557 const GLenum COLOR_ATTACHMENT1 = 0x8CE1;
558 const GLenum COLOR_ATTACHMENT2 = 0x8CE2;
559 const GLenum COLOR_ATTACHMENT3 = 0x8CE3;
560 const GLenum COLOR_ATTACHMENT4 = 0x8CE4;
561 const GLenum COLOR_ATTACHMENT5 = 0x8CE5;
562 const GLenum COLOR_ATTACHMENT6 = 0x8CE6;
563 const GLenum COLOR_ATTACHMENT7 = 0x8CE7;
564 const GLenum COLOR_ATTACHMENT8 = 0x8CE8;
565 const GLenum COLOR_ATTACHMENT9 = 0x8CE9;
566 const GLenum COLOR_ATTACHMENT10 = 0x8CEA;
567 const GLenum COLOR_ATTACHMENT11 = 0x8CEB;
568 const GLenum COLOR_ATTACHMENT12 = 0x8CEC;
569 const GLenum COLOR_ATTACHMENT13 = 0x8CED;
570 const GLenum COLOR_ATTACHMENT14 = 0x8CEE;
571 const GLenum COLOR_ATTACHMENT15 = 0x8CEF;
572 const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56;
573 const GLenum MAX_SAMPLES = 0x8D57;
574 const GLenum HALF_FLOAT = 0x140B;
575 const GLenum RG = 0x8227;
576 const GLenum RG_INTEGER = 0x8228;
577 const GLenum R8 = 0x8229;
578 const GLenum RG8 = 0x822B;
579 const GLenum R16F = 0x822D;
580 const GLenum R32F = 0x822E;
581 const GLenum RG16F = 0x822F;
582 const GLenum RG32F = 0x8230;
583 const GLenum R8I = 0x8231;
584 const GLenum R8UI = 0x8232;
585 const GLenum R16I = 0x8233;
586 const GLenum R16UI = 0x8234;
587 const GLenum R32I = 0x8235;
588 const GLenum R32UI = 0x8236;
589 const GLenum RG8I = 0x8237;
590 const GLenum RG8UI = 0x8238;
591 const GLenum RG16I = 0x8239;
592 const GLenum RG16UI = 0x823A;
593 const GLenum RG32I = 0x823B;
594 const GLenum RG32UI = 0x823C;
595 const GLenum VERTEX_ARRAY_BINDING = 0x85B5;
596 const GLenum R8_SNORM = 0x8F94;
597 const GLenum RG8_SNORM = 0x8F95;
598 const GLenum RGB8_SNORM = 0x8F96;
599 const GLenum RGBA8_SNORM = 0x8F97;
600 const GLenum SIGNED_NORMALIZED = 0x8F9C;
601 const GLenum PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69;
602 const GLenum COPY_READ_BUFFER = 0x8F36;
603 const GLenum COPY_WRITE_BUFFER = 0x8F37;
604 const GLenum COPY_READ_BUFFER_BINDING = 0x8F36; /* Same as COPY_READ_BUFFER */
605 const GLenum COPY_WRITE_BUFFER_BINDING = 0x8F37; /* Same as COPY_WRITE_BUFFER */
606 const GLenum UNIFORM_BUFFER = 0x8A11;
607 const GLenum UNIFORM_BUFFER_BINDING = 0x8A28;
608 const GLenum UNIFORM_BUFFER_START = 0x8A29;
609 const GLenum UNIFORM_BUFFER_SIZE = 0x8A2A;
610 const GLenum MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B;
611 const GLenum MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D;
612 const GLenum MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E;
613 const GLenum MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F;
614 const GLenum MAX_UNIFORM_BLOCK_SIZE = 0x8A30;
615 const GLenum MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31;
616 const GLenum MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33;
617 const GLenum UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34;
618 const GLenum ACTIVE_UNIFORM_BLOCKS = 0x8A36;
619 const GLenum UNIFORM_TYPE = 0x8A37;
620 const GLenum UNIFORM_SIZE = 0x8A38;
621 const GLenum UNIFORM_BLOCK_INDEX = 0x8A3A;
622 const GLenum UNIFORM_OFFSET = 0x8A3B;
623 const GLenum UNIFORM_ARRAY_STRIDE = 0x8A3C;
624 const GLenum UNIFORM_MATRIX_STRIDE = 0x8A3D;
625 const GLenum UNIFORM_IS_ROW_MAJOR = 0x8A3E;
626 const GLenum UNIFORM_BLOCK_BINDING = 0x8A3F;
627 const GLenum UNIFORM_BLOCK_DATA_SIZE = 0x8A40;
628 const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42;
629 const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43;
630 const GLenum UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44;
631 const GLenum UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46;
632 const GLenum INVALID_INDEX = 0xFFFFFFFF;
633 const GLenum MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122;
634 const GLenum MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125;
635 const GLenum MAX_SERVER_WAIT_TIMEOUT = 0x9111;
636 const GLenum OBJECT_TYPE = 0x9112;
637 const GLenum SYNC_CONDITION = 0x9113;
638 const GLenum SYNC_STATUS = 0x9114;
639 const GLenum SYNC_FLAGS = 0x9115;
640 const GLenum SYNC_FENCE = 0x9116;
641 const GLenum SYNC_GPU_COMMANDS_COMPLETE = 0x9117;
642 const GLenum UNSIGNALED = 0x9118;
643 const GLenum SIGNALED = 0x9119;
644 const GLenum ALREADY_SIGNALED = 0x911A;
645 const GLenum TIMEOUT_EXPIRED = 0x911B;
646 const GLenum CONDITION_SATISFIED = 0x911C;
647 const GLenum WAIT_FAILED = 0x911D;
648 const GLenum SYNC_FLUSH_COMMANDS_BIT = 0x00000001;
649 const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE;
650 const GLenum ANY_SAMPLES_PASSED = 0x8C2F;
651 const GLenum ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A;
652 const GLenum SAMPLER_BINDING = 0x8919;
653 const GLenum RGB10_A2UI = 0x906F;
654 const GLenum TEXTURE_SWIZZLE_R = 0x8E42;
655 const GLenum TEXTURE_SWIZZLE_G = 0x8E43;
656 const GLenum TEXTURE_SWIZZLE_B = 0x8E44;
657 const GLenum TEXTURE_SWIZZLE_A = 0x8E45;
658 const GLenum GREEN = 0x1904;
659 const GLenum BLUE = 0x1905;
660 const GLenum INT_2_10_10_10_REV = 0x8D9F;
661 const GLenum TRANSFORM_FEEDBACK = 0x8E22;
662 const GLenum TRANSFORM_FEEDBACK_PAUSED = 0x8E23;
663 const GLenum TRANSFORM_FEEDBACK_ACTIVE = 0x8E24;
664 const GLenum TRANSFORM_FEEDBACK_BINDING = 0x8E25;
665 const GLenum COMPRESSED_R11_EAC = 0x9270;
666 const GLenum COMPRESSED_SIGNED_R11_EAC = 0x9271;
667 const GLenum COMPRESSED_RG11_EAC = 0x9272;
668 const GLenum COMPRESSED_SIGNED_RG11_EAC = 0x9273;
669 const GLenum COMPRESSED_RGB8_ETC2 = 0x9274;
670 const GLenum COMPRESSED_SRGB8_ETC2 = 0x9275;
671 const GLenum COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276;
672 const GLenum COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277;
673 const GLenum COMPRESSED_RGBA8_ETC2_EAC = 0x9278;
674 const GLenum COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279;
675 const GLenum TEXTURE_IMMUTABLE_FORMAT = 0x912F;
676 const GLenum MAX_ELEMENT_INDEX = 0x8D6B;
677 const GLenum NUM_SAMPLE_COUNTS = 0x9380;
678 const GLenum TEXTURE_IMMUTABLE_LEVELS = 0x82DF;
680 const GLuint64 TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFF;
683 void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset,
684 GLintptr writeOffset, GLsizeiptr size);
685 // MapBufferRange, in particular its read-only and write-only modes,
686 // can not be exposed safely to JavaScript. GetBufferSubData
687 // replaces it for the purpose of fetching data back from the GPU.
688 void getBufferSubData(GLenum target, GLintptr offset, ArrayBufferData returnedData);
690 /* Framebuffer objects */
691 void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0,
692 GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
693 void framebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level,
695 any getInternalformatParameter(GLenum target, GLenum internalformat, GLenum pname);
696 void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments);
697 void invalidateSubFramebuffer(GLenum target, sequence<GLenum> attachments,
698 GLint x, GLint y, GLsizei width, GLsizei height);
699 void readBuffer(GLenum src);
701 /* Renderbuffer objects */
702 void renderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat,
703 GLsizei width, GLsizei height);
705 /* Texture objects */
706 void texStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
707 void texStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height,
709 void texImage3D(GLenum target, GLint level, GLint internalformat,
710 GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format,
711 GLenum type, ArrayBufferView? pixels);
712 void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
713 GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type,
714 ArrayBufferView? pixels);
715 void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
716 GLenum format, GLenum type, TexImageSource? source);
717 void copyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
718 GLint x, GLint y, GLsizei width, GLsizei height);
719 void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat,
720 GLsizei width, GLsizei height, GLsizei depth,
721 GLint border, GLsizei imageSize, ArrayBufferView data);
722 void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset,
723 GLsizei width, GLsizei height, GLsizei depth,
724 GLenum format, GLsizei imageSize, ArrayBufferView data);
726 /* Programs and shaders */
727 [WebGLHandlesContextLoss] GLint getFragDataLocation(WebGLProgram? program, DOMString name);
729 /* Uniforms and attributes */
730 void uniform1ui(WebGLUniformLocation? location, GLuint v0);
731 void uniform2ui(WebGLUniformLocation? location, GLuint v0, GLuint v1);
732 void uniform3ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2);
733 void uniform4ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
734 void uniform1uiv(WebGLUniformLocation? location, sequence<GLuint> value);
735 void uniform2uiv(WebGLUniformLocation? location, sequence<GLuint> value);
736 void uniform3uiv(WebGLUniformLocation? location, sequence<GLuint> value);
737 void uniform4uiv(WebGLUniformLocation? location, sequence<GLuint> value);
738 typedef (Float32Array or sequence<GLfloat>) UniformMatrixFVSource;
739 void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, UniformMatrixFVSource value);
740 void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, UniformMatrixFVSource value);
741 void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, UniformMatrixFVSource value);
742 void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, UniformMatrixFVSource value);
743 void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, UniformMatrixFVSource value);
744 void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, UniformMatrixFVSource value);
745 void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
746 void vertexAttribI4iv(GLuint index, sequence<GLint> v);
747 void vertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
748 void vertexAttribI4uiv(GLuint index, sequence<GLuint> v);
749 void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);
751 /* Writing to the drawing buffer */
752 void vertexAttribDivisor(GLuint index, GLuint divisor);
753 void drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount);
754 void drawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount);
755 /* TODO(kbr): argue against exposing this because it can't safely
756 offer better performance than drawElements */
757 void drawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLintptr offset);
759 /* Multiple Render Targets */
760 void drawBuffers(sequence<GLenum> buffers);
761 typedef (Int32Array or sequence<GLint>) ClearBufferIVSource;
762 typedef (Uint32Array or sequence<GLuint>) ClearBufferUIVSource;
763 typedef (Float32Array or sequence<GLfloat>) ClearBufferFVSource;
764 void clearBufferiv(GLenum buffer, GLint drawbuffer, ClearBufferIVSource value);
765 void clearBufferuiv(GLenum buffer, GLint drawbuffer, ClearBufferUIVSource value);
766 void clearBufferfv(GLenum buffer, GLint drawbuffer, ClearBufferFVSource value);
767 void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);
770 WebGLQuery? createQuery();
771 void deleteQuery(WebGLQuery? query);
772 [WebGLHandlesContextLoss] GLboolean isQuery(WebGLQuery? query);
773 void beginQuery(GLenum target, WebGLQuery? query);
774 void endQuery(GLenum target);
775 WebGLQuery? getQuery(GLenum target, GLenum pname);
776 any getQueryParameter(WebGLQuery? query, GLenum pname);
778 /* Sampler Objects */
779 WebGLSampler? createSampler();
780 void deleteSampler(WebGLSampler? sampler);
781 [WebGLHandlesContextLoss] GLboolean isSampler(WebGLSampler? sampler);
782 void bindSampler(GLuint unit, WebGLSampler? sampler);
783 void samplerParameteri(WebGLSampler? sampler, GLenum pname, GLint param);
784 void samplerParameterf(WebGLSampler? sampler, GLenum pname, GLfloat 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 Copy part of the data of the buffer bound to <em>readTarget</em> to the buffer bound to <em>writeTarget</em>.
962 See <a href="COPYING_BUFFERS">Copying Buffers</a> for restrictions imposed by the WebGL 2 API.
965 <p class="idl-code">void getBufferSubData(GLenum target, GLintptr offset, ArrayBufferData returnedData)
969 For the WebGLBuffer bound to the passed target, read <code>returnedData.byteLength</code>
970 bytes from the buffer starting at byte offset <code>offset</code> and write them
971 to <code>returnedData</code>. If <code>offset + returnedData.byteLength</code> would extend
972 beyond the end of the buffer an <code>INVALID_VALUE</code> error is generated.
973 If <code>returnedData</code> is null then an <code>INVALID_VALUE</code> error is generated.
974 If <code>offset</code> is less than zero, an <code>INVALID_VALUE</code> error is generated.
975 If zero is bound to <code>target</code>, an <code>INVALID_OPERATION</code> error is generated.
976 If <code>target</code> is <code>TRANSFORM_FEEDBACK_BUFFER</code>, and any transform feedback object
977 is currently active, an <code>INVALID_OPERATION</code> error is generated.
978 If any error is generated, no data is written to <code>returnedData</code>.
980 If the buffer is written and read sequentially by other operations and <code>getBufferSubData</code>,
981 it is the responsibility of the WebGL API to ensure that data are accessed consistently. This applies
982 even if the buffer is currently bound to a transform feedback binding point.
986 <!-- ======================================================================================================= -->
988 <h4>Framebuffer objects</h4>
991 <dt class="idl-code">any getFramebufferAttachmentParameter(GLenum target, GLenum attachment,
993 <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>
996 Return the value for the passed pname given the passed target and attachment. The type
997 returned is the natural type for the requested pname, as given in the following table:
999 <tr><th>pname</th><th>returned type</th></tr>
1000 <tr><td>FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE</td><td>GLint</td></tr>
1001 <tr><td>FRAMEBUFFER_ATTACHMENT_BLUE_SIZE</td><td>GLint</td></tr>
1002 <tr><td>FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING</td><td>Genum</td></tr>
1003 <tr><td>FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE</td><td>Genum</td></tr>
1004 <tr><td>FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE</td><td>GLint</td></tr>
1005 <tr><td>FRAMEBUFFER_ATTACHMENT_GREEN_SIZE</td><td>GLint</td></tr>
1006 <tr><td>FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</td><td>WebGLRenderbuffer or WebGLTexture</td></tr>
1007 <tr><td>FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</td><td>GLenum</td></tr>
1008 <tr><td>FRAMEBUFFER_ATTACHMENT_RED_SIZE</td><td>GLint</td></tr>
1009 <tr><td>FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE</td><td>GLint</td></tr>
1010 <tr><td>FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE</td><td>GLint</td></tr>
1011 <tr><td>FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER</td><td>Gint</td></tr>
1012 <tr><td>FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL</td><td>GLint</td></tr>
1014 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1015 <p>If an OpenGL error is generated, returns null.</p>
1018 <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)
1019 <span class="gl-spec">
1020 (<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-4.3.3">OpenGL ES 3.0.3 §4.3.3</a>,
1021 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBlitFramebuffer.xhtml" class="nonnormative">man page</a>)
1026 Transfer a rectangle of pixel values from one region of the read framebuffer to another in the draw
1027 framebuffer. If the value of SAMPLE_BUFFERS for the read framebuffer is one and the value of
1028 SAMPLE_BUFFERS for the draw framebuffer is zero, the samples corresponding to each pixel location in
1029 the source are converted to a single sample before being written to the destination.
1032 <p class="idl-code">void framebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
1033 <span class="gl-spec">
1034 (<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>,
1035 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glFramebufferTextureLayer.xhtml" class="nonnormative">man page</a>)
1040 <p class="idl-code">any getInternalformatParameter(GLenum target, GLenum internalformat, GLenum pname)
1041 <span class="gl-spec">
1042 (<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>,
1043 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetInternalformativ.xhtml" class="nonnormative">man page</a>)
1048 Return the value for the passed pname given the passed target and internalformat. The type
1049 returned is given in the following table:
1051 <tr><th>pname</th><th>returned type</th></tr>
1052 <tr><td>NUM_SAMPLE_COUNTS</td><td>GLint</td></tr>
1053 <tr><td>SAMPLES</td><td>Int32Array</td></tr>
1055 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1056 <p>If an OpenGL error is generated, returns null.</p>
1057 <p>Each query for SAMPLES returns a new typed array object instance.</p>
1060 <p class="idl-code">void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments)
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.5">OpenGL ES 3.0.3 §4.5</a>,
1063 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glInvalidateFramebuffer.xhtml" class="nonnormative">man page</a>)
1068 Equivalent to calling <code>invalidateSubFramebuffer</code> with <code>x</code> and <code>y</code>
1069 set to 0 and <code>width</code> and <code>height</code> set to the largest framebuffer object's
1070 attachments' width and height.
1073 <p class="idl-code">void invalidateSubFramebuffer (GLenum target, sequence<GLenum> attachments, GLint x, GLint y, GLsizei width, GLsizei height)
1074 <span class="gl-spec">
1075 (<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>,
1076 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glInvalidateSubFramebuffer.xhtml" class="nonnormative">man page</a>)
1081 Signal the GL that it need not preserve all contents of a bound framebuffer object.
1084 <p class="idl-code">void readBuffer(GLenum src)
1085 <span class="gl-spec">
1086 (<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>,
1087 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glReadBuffer.xhtml" class="nonnormative">man page</a>)
1092 Specify a color buffer of the read framebuffer as the read buffer.
1096 <!-- ======================================================================================================= -->
1098 <h4>Renderbuffer objects</h4>
1100 <dl class="methods">
1101 <dt class="idl-code">any getRenderbufferParameter(GLenum target, GLenum pname)
1102 <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>
1105 Return the value for the passed pname given the passed target. The type returned is the natural
1106 type for the requested pname, as given in the following table:
1108 <tr><th>pname</th><th>returned type</th></tr>
1109 <tr><td>RENDERBUFFER_WIDTH</td><td>GLint</td></tr>
1110 <tr><td>RENDERBUFFER_HEIGHT</td><td>GLint</td></tr>
1111 <tr><td>RENDERBUFFER_INTERNAL_FORMAT</td><td>GLenum</td></tr>
1112 <tr><td>RENDERBUFFER_RED_SIZE</td><td>GLint</td></tr>
1113 <tr><td>RENDERBUFFER_GREEN_SIZE</td><td>GLint</td></tr>
1114 <tr><td>RENDERBUFFER_BLUE_SIZE</td><td>GLint</td></tr>
1115 <tr><td>RENDERBUFFER_ALPHA_SIZE</td><td>GLint</td></tr>
1116 <tr><td>RENDERBUFFER_DEPTH_SIZE</td><td>GLint</td></tr>
1117 <tr><td>RENDERBUFFER_SAMPLES</td><td>GLint</td></tr>
1118 <tr><td>RENDERBUFFER_STENCIL_SIZE</td><td>GLint</td></tr>
1120 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1121 <p>If an OpenGL error is generated, returns null.</p>
1124 <p class="idl-code">void renderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
1125 <span class="gl-spec">
1126 (<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>,
1127 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glRenderbufferStorageMultisample.xhtml" class="nonnormative">man page</a>)
1133 <!-- ======================================================================================================= -->
1135 <h4>Texture objects</h4>
1138 Texture objects provide storage and state for texturing operations. If no WebGLTexture is bound
1139 (e.g., passing null or 0 to bindTexture) then attempts to modify or query the texture object shall
1140 generate an <code>INVALID_OPERATION</code> error. This is indicated in the functions below in cases
1141 where The OpenGL ES 3.0 specification allows the function to change the default texture.
1144 <dl class="methods">
1145 <dt class="idl-code">any getTexParameter(GLenum target, GLenum pname)
1146 <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>
1149 Return the value for the passed pname given the passed target. The type returned is the natural type for the
1150 requested pname, as given in the following table:
1152 <tr><th>pname</th><th>returned type</th></tr>
1153 <tr><td>TEXTURE_BASE_LEVEL</td><td>GLint</td></tr>
1154 <tr><td>TEXTURE_COMPARE_FUNC</td><td>GLenum</td></tr>
1155 <tr><td>TEXTURE_COMPARE_MODE</td><td>GLenum</td></tr>
1156 <tr><td>TEXTURE_IMMUTABLE_FORMAT</td><td>GLboolean</td></tr>
1157 <tr><td>TEXTURE_IMMUTABLE_LEVELS</td><td>GLuint</td></tr>
1158 <tr><td>TEXTURE_MAG_FILTER</td><td>GLenum</td></tr>
1159 <tr><td>TEXTURE_MAX_LEVEL</td><td>GLint</td></tr>
1160 <tr><td>TEXTURE_MAX_LOD</td><td>GLfloat</td></tr>
1161 <tr><td>TEXTURE_MIN_FILTER</td><td>GLenum</td></tr>
1162 <tr><td>TEXTURE_MIN_LOD</td><td>GLfloat</td></tr>
1163 <tr><td>TEXTURE_SWIZZLE_A</td><td>GLenum</td></tr>
1164 <tr><td>TEXTURE_SWIZZLE_B</td><td>GLenum</td></tr>
1165 <tr><td>TEXTURE_SWIZZLE_G</td><td>GLenum</td></tr>
1166 <tr><td>TEXTURE_SWIZZLE_R</td><td>GLenum</td></tr>
1167 <tr><td>TEXTURE_WRAP_R</td><td>GLenum</td></tr>
1168 <tr><td>TEXTURE_WRAP_S</td><td>GLenum</td></tr>
1169 <tr><td>TEXTURE_WRAP_T</td><td>GLenum</td></tr>
1171 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1172 <p>If an attempt is made to call this function with no WebGLTexture bound (see above), generates an
1173 <code>INVALID_OPERATION</code> error.</p>
1174 <p>If an OpenGL error is generated, returns null.</p>
1177 <p class="idl-code">void texStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
1178 <span class="gl-spec">
1179 (<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>,
1180 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glTexStorage2D.xhtml" class="nonnormative">man page</a>)
1185 Specify all the levels of a two-dimensional or cube-map texture at the same time. <br><br>
1187 The image contents are set as if a buffer of sufficient size initialized to 0 would be passed to
1188 each texImage2D call in the pseudocode in The OpenGL ES 3.0 specification section 3.8.4
1189 <span class="gl-spec">(<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>)</span>.
1191 <div class="note"><code>texStorage2D</code> should be considered a preferred alternative to
1192 <code>texImage2D</code>. It may have lower memory costs than <code>texImage2D</code> in some
1193 implementations.</div>
1196 <p class="idl-code"><a name="TEXSTORAGE3D">void texStorage3D</a>(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
1197 <span class="gl-spec">
1198 (<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>,
1199 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glTexStorage3D.xhtml" class="nonnormative">man page</a>)
1204 Specify all the levels of a three-dimensional texture or two-dimensional array texture. <br><br>
1206 The image contents are set as if a buffer of sufficient size initialized to 0 would be passed to
1207 each texImage3D call in the pseudocode in The OpenGL ES 3.0 specification section 3.8.4
1208 <span class="gl-spec">(<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>)</span>.
1210 <dt class="idl-code">void texImage3D(GLenum target, GLint level, GLenum internalformat,
1211 GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format,
1212 GLenum type, ArrayBufferView? pixels)
1213 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_full_spec_3.0.3.pdf#nameddest=section-3.8.3">OpenGL ES 3.0.3 §3.8.4</a>, <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glTexImage3D.xhtml">man page</a>)</span>
1216 Allocates and initializes the specified mipmap level of a three-dimensional or
1217 two-dimensional array texture. <br><br>
1219 If <code>pixels</code> is null, a buffer of sufficient size initialized to 0 is
1222 <div class="note editor">Needs update to determine restrictions for <em>format</em> and
1223 <em>pixels</em>. These restrictions also need to be updated for texImage2D and texSubImage2D
1224 inherited from the WebGL 1.0 API.</div>
1226 If an attempt is made to call this function with no WebGLTexture bound (see above), an
1227 <code>INVALID_OPERATION</code> error is generated. <br><br>
1229 <div class="note editor">Needs update to determine restrictions for <em>type</em></div>
1231 See <a href="#PIXEL_STORAGE_PARAMETERS">Pixel Storage Parameters</a> for WebGL-specific
1232 pixel storage parameters that affect the behavior of this function. <br><br>
1234 <div class="note">It is recommended to use <a href="#TEXSTORAGE3D">texStorage3D</a>
1235 instead of texImage3D to allocate three-dimensional textures. texImage3D may impose a
1236 higher memory cost compared to texStorage3D in some implementations.</div>
1239 <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)
1240 <span class="gl-spec">
1241 (<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>,
1242 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glTexSubImage3D.xhtml" class="nonnormative">man page</a>)
1247 Update a rectangular subregion of the currently bound WebGLTexture. <br><br>
1249 <div class="note editor">Needs update to determine restrictions for <em>format</em> and
1250 <em>pixels</em>. These restrictions also need to be updated for texImage2D and texSubImage2D
1251 inherited from the WebGL 1.0 API.</div>
1253 If an attempt is made to call this function with no WebGLTexture bound (see above), an
1254 <code>INVALID_OPERATION</code> error is generated. <br><br>
1256 <div class="note editor">Needs update to determine restrictions for <em>type</em></div>
1258 If <code>pixels</code> is null then an </code>INVALID_VALUE</code> error is generated. <br><br>
1260 See <a href="../1.0/#PIXEL_STORAGE_PARAMETERS">Pixel Storage Parameters</a> for WebGL-specific
1261 pixel storage parameters that affect the behavior of this function.
1264 <p class="idl-code">void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLenum format, GLenum type, TexImageSource? source) /* May throw DOMException */
1265 <span class="gl-spec">
1266 (<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>,
1267 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glTexSubImage3D.xhtml" class="nonnormative">man page</a>)
1272 Update a rectangular subregion of the currently bound WebGLTexture. <br><br>
1274 The depth of the updated subregion is set to 1. The width and height of the updated subregion are
1275 determined as specified in section <a href="../1.0/#TEXTURE_UPLOAD_SIZE">Texture Upload Width and
1276 Height</a>. <br><br>
1278 See <a href="../1.0/#TEXIMAGE2D_HTML">texImage2D</a> for the interpretation of
1279 the <em>format</em> and <em>type</em> arguments, and notes on
1280 the <code>UNPACK_PREMULTIPLY_ALPHA_WEBGL</code> pixel storage parameter. <br><br>
1282 The first pixel transferred from the source to the WebGL implementation corresponds to
1283 the upper left corner of the source. This behavior is modified by the
1284 the <code>UNPACK_FLIP_Y_WEBGL</code> <a href="../1.0/#PIXEL_STORAGE_PARAMETERS">pixel storage
1285 parameter</a>. <br><br>
1287 If an attempt is made to call this function with no WebGLTexture bound (see above), an
1288 <code>INVALID_OPERATION</code> error is generated. <br><br>
1290 <div class="note editor">Needs update to determine restrictions for <em>type</em></div>
1292 If this function is called with an <code>HTMLImageElement</code>
1293 or <code>HTMLVideoElement</code> whose origin differs from the origin of the containing
1294 Document, or with an <code>HTMLCanvasElement</code> whose <i>origin-clean</i> flag is
1295 set to false, a <code>SECURITY_ERR</code> exception must be
1296 thrown. See <a href="../1.0/#ORIGIN_RESTRICTIONS">Origin Restrictions</a>.<br><br>
1298 If <code>source</code> is null then an <code>INVALID_VALUE</code> error is
1301 See <a href="../1.0/#PIXEL_STORAGE_PARAMETERS">Pixel Storage Parameters</a> for WebGL-specific
1302 pixel storage parameters that affect the behavior of this function.
1305 <p class="idl-code">void copyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
1306 <span class="gl-spec">
1307 (<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>,
1308 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glCopyTexSubImage3D.xhtml" class="nonnormative">man page</a>)
1313 If an attempt is made to call this function with no WebGLTexture bound (see above), an
1314 <code>INVALID_OPERATION</code> error is generated. <br><br>
1316 For any pixel lying outside the frame buffer, all channels of the associated texel are
1317 initialized to 0; see <a href="../1.0/#READS_OUTSIDE_FRAMEBUFFER">Reading Pixels Outside the
1318 Framebuffer</a>. <br><br>
1321 <p class="idl-code">void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, ArrayBufferView data)
1322 <span class="gl-spec">
1323 (<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>,
1324 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glCompressedTexImage3D.xhtml" class="nonnormative">man page</a>)
1329 <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)
1330 <span class="gl-spec">
1331 (<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>,
1332 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glCompressedTexSubImage3D.xhtml" class="nonnormative">man page</a>)
1337 If an attempt is made to call these functions with no WebGLTexture bound (see above), an
1338 <code>INVALID_OPERATION</code> error is generated. <br><br>
1340 <div class="note editor">Needs update for WebGL 2.0</div>
1344 <!-- ======================================================================================================= -->
1346 <h4>Programs and Shaders</h4>
1348 <dl class="methods">
1350 <p class="idl-code">[WebGLHandlesContextLoss] GLint getFragDataLocation(WebGLProgram? program, DOMString name)
1351 <span class="gl-spec">
1352 (<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>,
1353 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetFragDataLocation.xhtml" class="nonnormative">man page</a>)
1357 <dt class="idl-code">any getProgramParameter(WebGLProgram? program, GLenum pname)
1358 <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>
1361 Return the value for the passed pname given the passed program. The type returned is the natural
1362 type for the requested pname, as given in the following table:
1364 <tr><th>pname</th><th>returned type</th></tr>
1365 <tr><td>DELETE_STATUS</td><td>GLboolean</td></tr>
1366 <tr><td>LINK_STATUS</td><td>GLboolean</td></tr>
1367 <tr><td>VALIDATE_STATUS</td><td>GLboolean</td></tr>
1368 <tr><td>ATTACHED_SHADERS</td><td>GLint</td></tr>
1369 <tr><td>ACTIVE_ATTRIBUTES</td><td>GLint</td></tr>
1370 <tr><td>ACTIVE_UNIFORMS</td><td>GLint</td></tr>
1371 <tr><td>TRANSFORM_FEEDBACK_BUFFER_MODE</td><td>GLenum</td></tr>
1372 <tr><td>TRANSFORM_FEEDBACK_VARYINGS</td><td>GLint</td></tr>
1373 <tr><td>ACTIVE_UNIFORM_BLOCKS</td><td>GLint</td></tr>
1375 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error and returns null.</p>
1376 <p>Returns null if any OpenGL errors are generated during the execution of this
1381 <!-- ======================================================================================================= -->
1383 <h4>Uniforms and attributes</h4>
1385 <dl class="methods">
1386 <dt class="idl-code">
1387 any getUniform(WebGLProgram? program, WebGLUniformLocation? location)
1388 <span class="gl-spec">
1389 (<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>,
1390 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniform.xhtml" class="nonnormative">man page</a>)
1394 Return the uniform value at the passed location in the passed program. The type returned is dependent
1395 on the uniform type. The types returned for the new uniform types in WebGL 2 are given in the
1398 <tr><th>uniform type</th><th>returned type</th></tr>
1399 <tr><td>uint</td><td>GLuint</td></tr>
1400 <tr><td>uvec2</td><td>Uint32Array (with 2 elements)</td></tr>
1401 <tr><td>uvec3</td><td>Uint32Array (with 3 elements)</td></tr>
1402 <tr><td>uvec4</td><td>Uint32Array (with 4 elements)</td></tr>
1403 <tr><td>mat2x3</td><td>Float32Array (with 6 elements)</td></tr>
1404 <tr><td>mat2x4</td><td>Float32Array (with 8 elements)</td></tr>
1405 <tr><td>mat3x2</td><td>Float32Array (with 6 elements)</td></tr>
1406 <tr><td>mat3x4</td><td>Float32Array (with 12 elements)</td></tr>
1407 <tr><td>mat4x2</td><td>Float32Array (with 8 elements)</td></tr>
1408 <tr><td>mat4x3</td><td>Float32Array (with 12 elements)</td></tr>
1409 <tr><td>any sampler type</td><td>GLint</td></tr>
1411 <p>The types returned for the uniform types shared with WebGL 1 are the same as in WebGL 1.</p>
1414 <p class="idl-code">void uniform[1234]ui(WebGLUniformLocation? location, ...)</p>
1415 <p class="idl-code">void uniform[1234]uiv(WebGLUniformLocation? location, ...)</p>
1416 <p class="idl-code">void uniformMatrix[234]x[234]fv(WebGLUniformLocation? location, ...)
1417 <span class="gl-spec">
1418 (<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>,
1419 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml" class="nonnormative">man page</a>)
1424 Each of the uniform* functions above sets the specified uniform or uniforms to the values
1425 provided. If the passed <code>location</code> is not null and was not obtained from the
1426 currently used program via an earlier call to <code>getUniformLocation</code>,
1427 an <code>INVALID_OPERATION</code> error will be generated. If the passed
1428 <code>location</code> is null, the data passed in will be silently ignored and no uniform
1429 variables will be changed.
1431 If the array passed to any of the vector forms (those ending in <code>v</code>) has an
1432 invalid length, an <code>INVALID_VALUE</code> error will be generated. The length is invalid
1433 if it is too short for or is not an integer multiple of the assigned type.
1435 <dt><p class="idl-code">void vertexAttribI4[u]i(GLuint indx, ...)</p>
1436 <p class="idl-code">void vertexAttribI4[u]iv(GLuint indx, ...)
1437 <span class="gl-spec">
1438 (<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>,
1439 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttrib.xhtml" class="nonnormative">man page</a>)
1443 Sets the vertex attribute at the passed index to the given constant integer value. Values set via the
1444 <code>vertexAttrib</code> are guaranteed to be returned from the <code>getVertexAttrib</code> function
1445 with the <code>CURRENT_VERTEX_ATTRIB</code> param, even if there have been intervening calls to
1446 <code>drawArrays</code> or <code>drawElements</code>.
1449 <p class="idl-code">void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset)
1450 <span class="gl-spec">
1451 (<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>,
1452 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttribPointer.xhtml" class="nonnormative">man page</a>)
1457 Assign the WebGLBuffer object currently bound to the ARRAY_BUFFER target to the vertex
1458 attribute at the passed index. Values are always left as integer values. Size is number of
1459 components per attribute. Stride and offset are in units of bytes. Passed stride and offset
1460 must be appropriate for the passed type and size or an <code>INVALID_OPERATION</code> error
1461 will be generated; see <a href="../1.0/#BUFFER_OFFSET_AND_STRIDE">Buffer Offset and Stride
1462 Requirements</a>. If offset is negative, an <code>INVALID_VALUE</code> error will be
1463 generated. If no WebGLBuffer is bound to the ARRAY_BUFFER target,
1464 an <code>INVALID_OPERATION</code> error will be generated. In WebGL, the maximum supported
1465 stride is 255; see <a href="../1.0/#VERTEX_STRIDE"> Vertex Attribute Data Stride</a>.
1467 <dt class="idl-code">any getVertexAttrib(GLuint index, GLenum pname)
1468 <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>
1471 Return the information requested in pname about the vertex attribute at the passed index. The
1472 type returned is dependent on the information requested, as shown in the following table:
1474 <tr><th>pname</th><th>returned type</th></tr>
1475 <tr><td>VERTEX_ATTRIB_ARRAY_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
1476 <tr><td>VERTEX_ATTRIB_ARRAY_ENABLED</td><td>GLboolean</td></tr>
1477 <tr><td>VERTEX_ATTRIB_ARRAY_SIZE</td><td>GLint</td></tr>
1478 <tr><td>VERTEX_ATTRIB_ARRAY_STRIDE</td><td>GLint</td></tr>
1479 <tr><td>VERTEX_ATTRIB_ARRAY_TYPE</td><td>GLenum</td></tr>
1480 <tr><td>VERTEX_ATTRIB_ARRAY_NORMALIZED</td><td>GLboolean</td></tr>
1481 <tr><td>CURRENT_VERTEX_ATTRIB</td><td>One of Float32Array, Int32Array or Uint32Array (each with 4 elements)</td></tr>
1482 <tr><td>VERTEX_ATTRIB_ARRAY_INTEGER</td><td>GLboolean</td></tr>
1483 <tr><td>VERTEX_ATTRIB_ARRAY_DIVISOR</td><td>GLint</td></tr>
1485 <p>For CURRENT_VERTEX_ATTRIB, the return type is dictated by the most recent call
1486 to the vertexAttrib family of functions for the given index. That is, if
1487 vertexAttribI4i* was used, the return type will be Int32Array; If vertexAttribI4ui*
1488 was used, the return type will be Uint32Array; Otherwise, Float32Array.
1490 <p>All queries returning sequences or typed arrays return a new object each time.</p>
1491 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1492 <p>If an OpenGL error is generated, returns null.</p>
1496 <!-- ======================================================================================================= -->
1498 <h4><a name="WRITING_TO_THE_DRAWING_BUFFER">Writing to the drawing buffer</a></h4>
1500 <dl class="methods">
1502 <p class="idl-code">void clear(GLbitfield mask)
1503 <span class="gl-spec">
1504 (<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>,
1505 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glClear.xhtml" class="nonnormative">man page</a>)
1510 Clear buffers to preset values. If an integer color buffer is among the buffers that would be
1511 cleared, an <code>INVALID_OPERATION</code> error is generated and nothing is cleared.
1514 <p class="idl-code">void vertexAttribDivisor(GLuint index, GLuint divisor)
1515 <span class="gl-spec">
1516 (<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>,
1517 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glVertexAttribDivisor.xhtml" class="nonnormative">man page</a>)
1522 Set the rate at which the vertex attribute identified by <code>index</code> advances when drawing.
1525 <p class="idl-code">void drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
1526 <span class="gl-spec">
1527 (<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>,
1528 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDrawArraysInstanced.xhtml" class="nonnormative">man page</a>)
1533 Draw <code>instanceCount</code> instances of geometry using the currently enabled vertex attributes.
1534 Vertex attributes which have a non-zero divisor advance once every divisor instances.
1537 <p class="idl-code">void drawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount)
1538 <span class="gl-spec">
1539 (<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>,
1540 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDrawElementsInstanced.xhtml" class="nonnormative">man page</a>)
1545 Draw <code>instanceCount</code> instances of geometry using the currently bound element array buffer.
1546 Vertex attributes which have a non-zero divisor advance once every divisor instances.
1549 <p class="idl-code">void drawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLintptr offset)
1550 <span class="gl-spec">
1551 (<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>,
1552 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDrawRangeElements.xhtml" class="nonnormative">man page</a>)
1557 Draw using the currently bound element array buffer. All error conditions specified for
1558 <code>drawElements</code> in the section <a href="../1.0/#WRITING_TO_THE_DRAWING_BUFFER">Writing
1559 to the drawing buffer</a> of the WebGL 1.0 specification apply. In addition, indices used to draw
1560 must lie between <code>start</code> and <code>end</code> inclusive. If the draw call references
1561 indices that are not within this range, an <code>INVALID_OPERATION</code> error is generated and
1562 nothing is drawn.<br><br>
1564 WebGL 2 performs additional error checking beyond that specified in OpenGL ES 3.0 during calls to
1565 <code>drawElements</code>, <code>drawArrays</code>, <code>drawRangeElements</code> and their
1566 instanced variants. See <a href="#RANGE_CHECKING">Range Checking</a>,
1567 <a href="#ENABLED_ATTRIBUTE">Enabled Attribute</a>, and <a href="#ACTIVE_UNIFORM_BLOCK_BACKING">Active
1568 Uniform Block Backing</a>.
1572 <!-- ======================================================================================================= -->
1574 <h4>Multiple render targets</h4>
1576 <dl class="methods">
1578 <p class="idl-code">void drawBuffers(sequence<GLenum> buffers)
1579 <span class="gl-spec">
1580 (<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>,
1581 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDrawBuffers.xhtml" class="nonnormative">man page</a>)
1586 Define the draw buffers to which all fragment colors are written.
1589 <p class="idl-code">void clearBufferiv(GLenum buffer, GLint drawbuffer, ClearBufferISource value)</p>
1590 <p class="idl-code">void clearBufferuiv(GLenum buffer, GLint drawbuffer, ClearBufferUISource value)</p>
1591 <p class="idl-code">void clearBufferfv(GLenum buffer, GLint drawbuffer, ClearBufferFSource value)</p>
1592 <p class="idl-code">void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
1593 <span class="gl-spec">
1594 (<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>,
1595 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glClearBuffer.xhtml" class="nonnormative">man page</a>)
1600 Set every pixel in the specified buffer to a constant value. The clearBuffer function that should be
1601 used for a color buffer depends on the type of the color buffer, given in the following table:
1603 <tr><th>Type of buffer</th><th>clearBuffer function</th></tr>
1604 <tr><td>floating point</td><td>clearBufferfv</td></tr>
1605 <tr><td>fixed point</td><td>clearBufferfv</td></tr>
1606 <tr><td>signed integer</td><td>clearBufferiv</td></tr>
1607 <tr><td>unsigned integer</td><td>clearBufferuiv</td></tr>
1609 If <code>buffer</code> is <code>COLOR_BUFFER</code> and the function is not chosen according to the
1610 above table, an <code>INVALID_OPERATION</code> error is generated and nothing is cleared.
1613 <!-- ======================================================================================================= -->
1615 <h4>Query objects</h4>
1617 <dl class="methods">
1619 <p class="idl-code">WebGLQuery? createQuery()
1620 <span class="gl-spec">
1621 (<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>,
1622 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGenQueries.xhtml" class="nonnormative">man page</a>)
1627 Create a WebGLQuery object and initialize it with a query object name as if by calling glGenQueries.
1630 <p class="idl-code">void deleteQuery(WebGLQuery? query)
1631 <span class="gl-spec">
1632 (<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>,
1633 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteQueries.xhtml" class="nonnormative">man page</a>)
1638 Delete the query object contained in the passed <code class="interface">WebGLQuery</code> as if by calling
1639 glDeleteQueries. If the query has already been deleted the call has no effect.
1640 Note that the query object will be deleted when the <code class="interface">WebGLQuery</code> object is destroyed.
1641 This method merely gives the author greater control over when the query object is destroyed.
1644 <p class="idl-code">[WebGLHandlesContextLoss] GLboolean isQuery(WebGLQuery? query)
1645 <span class="gl-spec">
1646 (<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>,
1647 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glIsQuery.xhtml" class="nonnormative">man page</a>)
1652 Return true if the passed <code class="interface">WebGLQuery</code> is valid and false otherwise.<br><br>
1654 Returns false if the query's <a href="../1.0/#webgl-object-invalidated-flag">invalidated
1658 <p class="idl-code">void beginQuery(GLenum target, WebGLQuery? query)
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-2.13">OpenGL ES 3.0.3 §2.13</a>,
1661 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBeginQuery.xhtml" class="nonnormative">man page</a>)
1666 Begin an asynchronous query. <em>Target</em> indicates the type of query to be performed.
1669 <p class="idl-code">void endQuery(GLenum target)
1670 <span class="gl-spec">
1671 (<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>,
1672 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBeginQuery.xhtml" class="nonnormative">man page</a>)
1677 Mark the end of the sequence of commands to be tracked for the query type given by
1678 <em>target</em>. When the final query result is available, the query object is updated
1679 to indicate this and the result may be retrieved by calling <code>getQueryParameter</code>.
1682 <p class="idl-code">WebGLQuery? getQuery(GLenum target, GLenum pname)
1683 <span class="gl-spec">
1684 (<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>,
1685 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetQueryiv.xhtml" class="nonnormative">man page</a>)
1690 <p>Returns information about a query target <em>target</em>, which must be one
1691 of <code>ANY_SAMPLES_PASSED</code> or <code>ANY_SAMPLES_PASSED_CONSERVATIVE</code> for
1692 occlusion queries, or <code>TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN</code> for primitive
1693 queries. <em>pname</em> specifies the symbolic name of a query object target
1694 parameter. Currently it must be <code>CURRENT_QUERY</code>, and returns either the
1695 currently active query for the target, or null.</p>
1697 <p>If <em>target</em> or <em>pname</em> are not in the list above, generates
1698 an <code>INVALID_ENUM</code> error and returns null.</p>
1700 <p>Returns null if any OpenGL errors are generated during the execution of this
1704 <p class="idl-code">any getQueryParameter(WebGLQuery? query, GLenum pname)
1705 <span class="gl-spec">
1706 (<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>,
1707 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetQueryObjectuiv.xhtml" class="nonnormative">man page</a>)
1712 <p>Returns a parameter <em>pname</em> of a query object. <code>QUERY_RESULT</code> returns
1713 the value of the query object's passed samples counter.
1714 <code>QUERY_RESULT_AVAILABLE</code> returns whether the samples counter is immediately
1715 available. The type returned is the natural type for the requested pname, as given in the
1716 following table:</p>
1718 <tr><th>pname</th><th>returned type</th></tr>
1719 <tr><td>QUERY_RESULT</td><td>GLuint</td></tr>
1720 <tr><td>QUERY_RESULT_AVAILABLE</td><td>GLboolean</td></tr>
1723 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code>
1724 error and returns null.</p>
1726 <p>If <em>query</em> is not a valid query object, or is a currently active query object,
1727 generates an <code>INVALID_OPERATION</code> error and returns null.
1729 <p>Returns null if any OpenGL errors are generated during the execution of this
1734 <!-- ======================================================================================================= -->
1736 <h4>Sampler objects</h4>
1738 <dl class="methods">
1740 <p class="idl-code">WebGLSampler? createSampler()
1741 <span class="gl-spec">
1742 (<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>,
1743 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGenSamplers.xhtml" class="nonnormative">man page</a>)
1748 Create a <code class="interface">WebGLSampler</code> object and initialize it with a sampler object name as if by
1749 calling glGenSamplers.
1752 <p class="idl-code">void deleteSampler(WebGLSampler? sampler)
1753 <span class="gl-spec">
1754 (<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>,
1755 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteSamplers.xhtml" class="nonnormative">man page</a>)
1760 Delete the sampler object contained in the passed <code class="interface">WebGLSampler</code> as if by calling
1761 glDeleteSamplers. If the sampler has already been deleted the call has no effect.
1762 Note that the sampler object will be deleted when the <code class="interface">WebGLSampler</code> object is destroyed.
1763 This method merely gives the author greater control over when the sampler object is destroyed.
1766 <p class="idl-code">[WebGLHandlesContextLoss] GLboolean isSampler(WebGLSampler? sampler)
1767 <span class="gl-spec">
1768 (<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>,
1769 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glIsSampler.xhtml" class="nonnormative">man page</a>)
1774 Return true if the passed <code class="interface">WebGLSampler</code> is valid and false otherwise. <br><br>
1776 Returns false if the sampler's <a href="../1.0/#webgl-object-invalidated-flag">invalidated
1780 <p class="idl-code">void bindSampler(GLuint unit, WebGLSampler? sampler)
1781 <span class="gl-spec">
1782 (<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>,
1783 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBindSampler.xhtml" class="nonnormative">man page</a>)
1788 Bind the sampler object contained in the passed <code>WebGLSampler</code> to the texture unit at the
1789 passed index. If a sampler is bound to a texture unit, the sampler's state supersedes the sampling
1790 state of the texture bound to that texture unit.
1793 <p class="idl-code">void samplerParameteri(WebGLSampler? sampler, GLenum pname, GLint param);</p>
1794 <p class="idl-code">void samplerParameterf(WebGLSampler? sampler, GLenum pname, GLfloat param);</p>
1795 <span class="gl-spec">
1796 (<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>,
1797 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glSamplerParameter.xhtml" class="nonnormative">man page</a>)
1801 <dt class="idl-code">any getSamplerParameter(WebGLSampler? sampler, GLenum pname)
1802 <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>
1805 Return the information requested in pname about the given WebGLSampler, passed as <em>sampler</em>. The
1806 type returned is dependent on the information requested, as shown in the following table:
1808 <tr><th>pname</th><th>returned type</th></tr>
1809 <tr><td>TEXTURE_COMPARE_FUNC</td><td>GLenum</td></tr>
1810 <tr><td>TEXTURE_COMPARE_MODE</td><td>GLenum</td></tr>
1811 <tr><td>TEXTURE_MAG_FILTER</td><td>GLenum</td></tr>
1812 <tr><td>TEXTURE_MAX_LOD</td><td>GLfloat</td></tr>
1813 <tr><td>TEXTURE_MIN_FILTER</td><td>GLenum</td></tr>
1814 <tr><td>TEXTURE_MIN_LOD</td><td>GLfloat</td></tr>
1815 <tr><td>TEXTURE_WRAP_R</td><td>GLenum</td></tr>
1816 <tr><td>TEXTURE_WRAP_S</td><td>GLenum</td></tr>
1817 <tr><td>TEXTURE_WRAP_T</td><td>GLenum</td></tr>
1819 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
1820 <p>If an OpenGL error is generated, returns null.</p>
1824 <!-- ======================================================================================================= -->
1826 <h4>Sync objects</h4>
1829 Sync objects can be used to synchronize execution between the GL server and the client.
1832 <dl class="methods">
1834 <p class="idl-code">WebGLSync? fenceSync(GLenum condition, GLbitfield flags)
1835 <span class="gl-spec">
1836 (<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>,
1837 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glFenceSync.xhtml" class="nonnormative">man page</a>)
1842 Create a new fence sync object and insert an associated fence command in the GL command stream.
1845 <p class="idl-code">[WebGLHandlesContextLoss] GLboolean isSync(WebGLSync? sync)
1846 <span class="gl-spec">
1847 (<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>,
1848 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glIsSync.xhtml" class="nonnormative">man page</a>)
1853 Return true if the passed <code class="interface">WebGLSync</code> is valid and false otherwise. <br><br>
1855 Returns false if the sync's <a href="../1.0/#webgl-object-invalidated-flag">invalidated
1859 <p class="idl-code">void deleteSync(WebGLSync? sync)
1860 <span class="gl-spec">
1861 (<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>,
1862 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteSync.xhtml" class="nonnormative">man page</a>)
1867 Delete the sync object contained in the passed <code class="interface">WebGLSync</code> as if by calling
1868 glDeleteSync. If the sync has already been deleted the call has no effect.
1869 Note that the sync object will be deleted when the <code class="interface">WebGLSync</code> object is destroyed.
1870 This method merely gives the author greater control over when the sync object is destroyed.
1873 <p class="idl-code">GLenum clientWaitSync(WebGLSync? sync, GLbitfield flags, GLuint64 timeout)
1874 <span class="gl-spec">
1875 (<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>,
1876 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glClientWaitSync.xhtml" class="nonnormative">man page</a>)
1882 Block execution until the passed sync object is signaled or the specified timeout has
1883 passed. <code>timeout</code> is in units of nanoseconds.
1887 Returns one of four status values. A return value of <code>ALREADY_SIGNALED</code> indicates
1888 that <code>sync</code> was signaled at the time <code>clientWaitSync</code> was
1889 called. <code>ALREADY_SIGNALED</code> will always be returned if <code>sync</code> was signaled, even
1890 if <code>timeout</code> was zero. A return value of <code>TIMEOUT_EXPIRED</code> indicates that the specified
1891 timeout period expired before <code>sync</code> was signaled. A return value of <code>CONDITION_SATISFIED</code>
1892 indicates that <code>sync</code> was signaled before the timeout expired. Finally, if an error occurs, in
1893 addition to generating an error as specified below, returns <code>WAIT_FAILED</code> without blocking.
1897 <code>flags</code> controls command flushing behavior and may include <code>SYNC_FLUSH_COMMANDS_BIT</code>. If
1898 any other bit is set in <code>flags</code> an <code>INVALID_OPERATION</code> error is
1899 generated. If <code>SYNC_FLUSH_COMMANDS_BIT</code> is set in <code>flags</code> and <code>sync</code> is
1900 unsignaled when <code>clientWaitSync</code> is called, then the equivalent of <code>flush</code> will be
1901 performed before blocking on <code>sync</code>.
1905 As discussed in the <a href="#CLIENT_WAIT_SYNC">differences section</a>, WebGL implementations must impose a
1906 short maximum timeout to prevent blocking the main thread either indefinitely or for long periods of time.
1910 The implementation-defined maximum timeout is not specified. It should be set low enough to keep applications
1911 from compromising interactivity by waiting for long periods of time. It is acceptable for an implementation to
1912 impose a zero maximum timeout. WebGL applications should not use clientWaitSync to block execution for long
1916 <p>Returns <code>WAIT_FAILED</code> if any OpenGL errors are generated during the execution of this
1921 <p class="idl-code">void waitSync(WebGLSync? sync, GLbitfield flags, GLuint64 timeout)
1922 <span class="gl-spec">
1923 (<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>,
1924 <a href="http://www.khronos.org/opengles/sdk/docs/man3/html/glWaitSync.xhtml" class="nonnormative">man page</a>)
1929 Return immediately, but wait on the GL server until the passed sync object is signaled or an
1930 implementation-dependent timeout has passed. The passed <em>timeout</em> must be set to
1931 <code>TIMEOUT_IGNORED</code>.
1934 In the absence of the possibility of synchronizing between multiple GL contexts, calling waitSync is effectively a no-op.
1937 <dt class="idl-code">any getSyncParameter(WebGLSync? sync, GLenum pname)
1938 <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>
1941 Return the value for the passed pname given the passed WebGLSync object. The type returned is the natural
1942 type for the requested pname, as given in the following table:
1944 <tr><th>pname</th><th>returned type</th></tr>
1945 <tr><td>OBJECT_TYPE</td><td>GLenum</td></tr>
1946 <tr><td>SYNC_STATUS</td><td>GLenum</td></tr>
1947 <tr><td>SYNC_CONDITION</td><td>GLenum</td></tr>
1948 <tr><td>SYNC_FLAGS</td><td>GLbitfield</td></tr>
1950 <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error and returns null.</p>
1951 <p>Returns null if any OpenGL errors are generated during the execution of this
1956 <!-- ======================================================================================================= -->
1958 <h4>Transform feedback</h4>
1961 Transform feedback mode captures the values of output variables written by the vertex shader. The
1962 vertices are captured before flatshading and clipping. The transformed vertices may be optionally
1963 discarded after being stored into one or more buffer objects, or they can be passed on down to the
1964 clipping stage for further processing. The set of output variables captured is determined when a
1968 <dl class="methods">
1969 <dt class="idl-code">WebGLTransformFeedback? createTransformFeedback()
1970 <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>,
1971 similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGenTransformFeedbacks.xhtml">glGenTransformFeedbacks</a>)</span>
1973 Create a <code class="interface">WebGLTransformFeedback</code> object and initialize it with a transform feedback object name as if by
1974 calling glGenTransformFeedbacks.
1976 <dt class="idl-code">void deleteTransformFeedback(WebGLTransformFeedback? transformFeedback)
1977 <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>,
1978 similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteTransformFeedbacks.xhtml">glDeleteTransformFeedbacks</a>)</span>
1980 Delete the transform feedback object contained in the passed <code class="interface">WebGLTransformFeedback</code> as if by calling
1981 glDeleteTransformFeedbacks. If the transform feedback has already been deleted the call has no effect.
1982 Note that the transform feedback object will be deleted when the <code class="interface">WebGLTransformFeedback</code> object is destroyed.
1983 This method merely gives the author greater control over when the transform feedback object is destroyed.
1985 <dt class="idl-code">[WebGLHandlesContextLoss] GLboolean isTransformFeedback(WebGLTransformFeedback? transformFeedback)
1986 <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>,
1987 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glIsTransformFeedback.xhtml">man page</a>)</span>
1989 Return true if the passed <code class="interface">WebGLTransformFeedback</code> is valid and false otherwise. <br><br>
1991 Returns false if the transform feedback's <a href="../1.0/#webgl-object-invalidated-flag">invalidated
1994 <dt class="idl-code">void bindTransformFeedback (GLenum target, WebGLTransformFeedback? transformFeedback)
1995 <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>,
1996 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBindTransformFeedback.xhtml">man page</a>)</span>
1998 Bind the given <code class="interface">WebGLTransformFeedback</code> object.
1999 If <code class="param">transformFeedback</code> is null, the default transform feedback object provided by the context
2002 <dt class="idl-code">void beginTransformFeedback(GLenum primitiveMode)
2003 <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>,
2004 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBeginTransformFeedback.xhtml">man page</a>)</span>
2007 <dt class="idl-code">void endTransformFeedback()
2008 <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>,
2009 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glBeginTransformFeedback.xhtml">man page</a>)</span>
2012 <dt class="idl-code">void pauseTransformFeedback()
2013 <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>,
2014 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glPauseTransformFeedback.xhtml">man page</a>)</span>
2017 <dt class="idl-code">void resumeTransformFeedback()
2018 <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>,
2019 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glResumeTransformFeedback.xhtml">man page</a>)</span>
2022 <dt class="idl-code">void transformFeedbackVaryings(WebGLProgram? program, sequence<DOMString> varyings, GLenum bufferMode)
2023 <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>,
2024 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glTransformFeedbackVaryings.xhtml">man page</a>)</span>
2027 <dt class="idl-code">WebGLActiveInfo? getTransformFeedbackVarying(WebGLProgram? program, GLuint index)
2028 <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>,
2029 <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man3/html/glGetTransformFeedbackVarying.xhtml">man page</a>)</span>
2033 <!-- ======================================================================================================= -->
2035 <h4>Uniform Buffer objects</h4>
2038 Uniform buffer objects provide the storage for named uniform blocks, so the values of active uniforms
2039 in named uniform blocks may be changed by modifying the contents of the buffer object.
2042 <dl class="methods">
2043 <dt class="idl-code">void bindBufferBase(GLenum target, GLuint index, WebGLBuffer? buffer)
2044 <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>,
2045 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBindBufferBase.xhtml">man page</a>)</span>
2047 Binds the given <code class="interface">WebGLBuffer</code> object to the binding point at <code class="param">index</code> of the array of targets
2048 specified by <code class="param">target</code>.
2050 <dt class="idl-code">void bindBufferRange(GLenum target, GLuint index, WebGLBuffer? buffer, GLintptr offset, GLsizeiptr size)
2051 <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>,
2052 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBindBufferRange.xhtml">man page</a>)</span>
2054 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>
2055 to the binding point at <code class="param">index</code> of the array of targets specified by <code class="param">target</code>
2057 <dt class="idl-code">sequence<GLuint>? getUniformIndices(WebGLProgram? program, sequence<DOMString> uniformNames)
2058 <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>,
2059 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniformIndices.xhtml">man page</a>)</span>
2061 Retrieves the indices of a number of uniforms within <code class="param">program</code>.
2063 <dt class="idl-code">sequence<GLint>? getActiveUniforms(WebGLProgram? program, sequence<GLuint> uniformIndices, GLenum pname)
2064 <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>,
2065 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniformsiv.xhtml">man page</a>)</span>
2067 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
2068 are specified in the array of <code class="param">uniformIndices</code>.
2070 <dt class="idl-code">GLuint getUniformBlockIndex(WebGLProgram? program, DOMString uniformBlockName)
2071 <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>,
2072 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGetUniformBlockIndex.xhtml">man page</a>)</span>
2074 Retrieves the index of a uniform block within <code class="param">program</code>.
2076 <dt class="idl-code">any getActiveUniformBlockParameter(WebGLProgram? program, GLuint uniformBlockIndex, GLenum pname)
2077 <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>,
2078 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniformBlockiv.xhtml">man page</a>)</span>
2080 Retrieves information about an active uniform block within <code class="param">program</code>. The type returned is the natural type for the requested
2081 <code class="param">pname</code>, as given in the following table:
2083 <tr><th>pname</th><th>returned type</th></tr>
2084 <tr><td>UNIFORM_BLOCK_BINDING</td><td>GLuint</td></tr>
2085 <tr><td>UNIFORM_BLOCK_DATA_SIZE</td><td>GLuint</td></tr>
2086 <tr><td>UNIFORM_BLOCK_ACTIVE_UNIFORMS</td><td>GLuint</td></tr>
2087 <tr><td>UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES</td><td>Uint32Array</td></tr>
2088 <tr><td>UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER</td><td>GLboolean</td></tr>
2089 <tr><td>UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER</td><td>GLboolean</td></tr>
2091 <p>If <code class="param">pname</code> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
2092 <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
2093 value of <code>ACTIVE_UNIFORM_BLOCKS</code>, generates an <code>INVALID_VALUE</code> error.</p>
2094 <p>If an OpenGL error is generated, returns null.</p>
2096 <dt class="idl-code">DOMString? getActiveUniformBlockName(WebGLProgram? program, GLuint uniformBlockIndex)
2097 <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>,
2098 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGetActiveUniformBlockName.xhtml">man page</a>)</span>
2100 Retrieves the name of the active uniform block at <code class="param">uniformBlockIndex</code> within <code class="param">program</code>.
2102 <dt class="idl-code">void uniformBlockBinding(WebGLProgram? program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
2103 <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>,
2104 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glUniformBlockBinding.xhtml">man page</a>)</span>
2106 Assigns binding points for active uniform blocks.
2109 <!-- ======================================================================================================= -->
2111 <h4>Vertex Array objects</h4>
2114 Vertex Array objects (sometimes referred to as VAOs) encapsulate all state related to the
2115 definition of data used by the vertex processor.
2118 <dl class="methods">
2119 <dt class="idl-code">void bindVertexArray(WebGLVertexArrayObject? vertexArray)
2120 <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>,
2121 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glBindVertexArray.xhtml">man page</a>)</span>
2123 Bind the given <code class="interface">WebGLVertexArrayObject</code> object.
2124 If <code class="param">vertexArray</code> is null, the default vertex array provided by the context
2127 <dt class="idl-code">WebGLVertexArrayObject? createVertexArray()
2128 <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>,
2129 similar to <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glGenVertexArrays.xhtml">glGenVertexArrays</a>)</span>
2131 Create a <code class="interface">WebGLVertexArrayObject</code> object and initialize it with a vertex array object name as if by
2132 calling glGenVertexArrays.
2134 <dt class="idl-code">void deleteVertexArray(WebGLVertexArrayObject? vertexArray)
2135 <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>,
2136 similar to <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glDeleteVertexArrays.xhtml">glDeleteVertexArrays</a>)</span>
2138 Delete the vertex array object contained in the passed <code class="interface">WebGLVertexArrayObject</code> as if by calling
2139 glDeleteVertexArrays. If the vertex array has already been deleted the call has no effect.
2140 Note that the vertex array object will be deleted when the <code class="interface">WebGLVertexArrayObject</code> object is destroyed.
2141 This method merely gives the author greater control over when the vertex array object is
2144 <dt class="idl-code">[WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray)
2145 <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>,
2146 <a class="nonnormative" href="https://www.khronos.org/opengles/sdk/docs/man3/html/glIsVertexArray.xhtml">man page</a>)</span>
2148 Return true if the passed <code class="interface">WebGLVertexArrayObject</code> is valid and false otherwise. <br><br>
2150 Returns false if the vertex array's <a href="../1.0/#webgl-object-invalidated-flag">invalidated
2154 <!-- ======================================================================================================= -->
2156 <h2><a name="webgl_1_2_differences">Other differences Between WebGL 2.0 and WebGL 1.0</a></h2>
2158 <div class="note editor">
2159 Needs update for WebGL 2.0
2162 <h3><a name="BACKWARDS_INCOMPATIBILITY">Backwards Incompatibility</a></h3>
2167 The WebGL 2 API may behave differently in cases where the WebGL 1 API generates an error.
2168 Code written against the WebGL 1 API that generates errors is not guaranteed to be
2169 forward-compatible with WebGL 2.
2175 Some extensions that may have been supported in the WebGL 1 API are removed from the WebGL
2176 2 API. For more details, see the
2177 <a href="http://www.khronos.org/registry/webgl/extensions/">WebGL Extension Registry</a>.
2181 Extensions are typically removed only if equivalent functionality is available in the WebGL
2182 2 API either in the core specification or in an improved extension. When an application
2183 using WebGL 1 extensions is modified to run on the WebGL 2 API, it is often possible to
2184 create a dummy extension object for each of the promoted extensions which simply
2185 redirects calls to the appropriate WebGL 2 API functions. If the application is using shader
2186 language extensions, porting shaders to GLSL ES 3.00 is typically required.
2189 <h4>Non-Power-of-Two Texture Access</h4>
2192 Texture access works in the WebGL 2 API as in the OpenGL ES 3.0 API. Sampling a
2193 non-power-of-two image with wrapping mode other than CLAMP_TO_EDGE and minification filter
2194 other than NEAREST or LINEAR does not always return (R, G, B, A) = (0, 0, 0, 1) in the
2195 WebGL 2 API, i.e. mipmapping and all wrapping modes are supported for non-power-of-two
2199 <h3>New Features Supported in the WebGL 2 API</h3>
2202 <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>
2203 <li>Pixel buffer objects <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.7.1">OpenGL ES 3.0.3 §3.7.1</a> and <a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-4.3">OpenGL ES 3.0.3 §4.3</a>)</span></li>
2204 <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>
2205 <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>
2208 <h3>GLSL ES 3.00 support</h3>
2211 In addition to supporting The OpenGL ES Shading Language, Version 1.00, the WebGL 2 API also accepts
2212 shaders written in The OpenGL ES Shading Language, Version 3.00
2213 <a href="#refsGLES30GLSL">[GLES30GLSL]</a>, with some restrictions.
2218 A shader referencing state variables or functions that are available in other versions of GLSL,
2219 such as that found in versions of OpenGL for the desktop, must not be allowed to load.
2224 As in the WebGL 1.0 API, identifiers starting with "webgl_" and "_webgl_" are reserved for use by
2225 WebGL. A shader which declares a function, variable, structure name, or structure field starting with
2226 these prefixes must not be allowed to load.
2229 <h4>Maximum GLSL Token Size</h4>
2232 WebGL 1.0 supports tokens up to 256 characters in length. WebGL 2.0 follows The OpenGL ES Shading Language, Version 3.00
2233 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf#nameddest=section-3.8">OpenGL ES 3.0.3 §3.8</a>)</span>
2234 and allows tokens up to 1024 characters in length. Shaders containing tokens longer than 1024 characters must fail to compile.
2237 <h3>Vertex Attribute Divisor</h3>
2240 In the WebGL 2 API, vertex attributes which have a non-zero divisor do not advance during calls to
2241 <code>drawArrays</code> and <code>drawElements</code>.
2242 <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>
2245 <!-- ======================================================================================================= -->
2247 <h2><a name="webgl_gl_differences">Differences Between WebGL and OpenGL ES 3.0</a></h2>
2249 <div class="note editor">
2250 Needs update for WebGL 2.0
2254 This section describes changes made to the WebGL API relative to the
2255 OpenGL ES 3.0 API to improve portability across various operating
2256 systems and devices.
2259 <h3><a name="BUFFER_OBJECT_BINDING">Buffer Object Binding</a></h3>
2263 <th>WebGL buffer type</th>
2264 <th>Binding points that set this type</th>
2267 <td><em>undefined</em></td>
2271 <td><em>element array</em></td>
2272 <td>ELEMENT_ARRAY_BUFFER</td>
2275 <td><em>other data</em></td>
2276 <td>all binding points except ELEMENT_ARRAY_BUFFER, COPY_READ_BUFFER and COPY_WRITE_BUFFER</td>
2281 In the WebGL 2 API, buffers have their WebGL buffer type initially set to <em>undefined</em>. Calling
2282 <code>bindBuffer</code>, <code>bindBufferRange</code> or <code>bindBufferBase</code> with the
2283 <code>target</code> argument set to any buffer binding point except <code>COPY_READ_BUFFER</code> or
2284 <code>COPY_WRITE_BUFFER</code> will then set the WebGL buffer type of the buffer being bound according
2289 Any call to one of these functions which attempts to bind a WebGLBuffer that has the <em>element
2290 array</em> WebGL buffer type to a binding point that falls under <em>other data</em>, or bind a
2291 WebGLBuffer which has the <em>other data</em> WebGL buffer type to <code>ELEMENT_ARRAY_BUFFER</code>
2292 will generate an <code>INVALID_OPERATION</code> error, and the state of the binding point will remain
2297 This restriction implies that a given buffer object may contain either indices or other data, but
2302 These restrictions are similar to <a href="../1.0/#BUFFER_OBJECT_BINDING">buffer object binding
2303 restrictions in the WebGL 1 specification</a>.
2307 In addition, a buffer can not be simultaneously bound to a transform feedback buffer binding point
2308 and another buffer binding point in the WebGL 2 API. Attempting to violate this rule generates an
2309 <code>INVALID_OPERATION</code> error, and the state of the binding point will remain untouched.
2312 <h3><a name="COPYING_BUFFERS">Copying Buffers</a></h3>
2315 Attempting to use <code>copyBufferSubData</code> to copy between buffers that have
2316 <em>element array</em> and <em>other data</em> WebGL buffer types as specified in section
2317 <a href="#BUFFER_OBJECT_BINDING">Buffer Object Binding</a> generates an
2318 <code>INVALID_OPERATION</code> error and no copying is performed. Copying data into a buffer which
2319 has the <em>undefined</em> WebGL buffer type sets its WebGL buffer type to the WebGL buffer type of
2323 <h3>Draw Buffers</h3>
2326 The value of the MAX_COLOR_ATTACHMENTS parameter must be equal to that of the MAX_DRAW_BUFFERS
2330 <h3>No Program Binaries</h3>
2333 Accessing binary representations of compiled shader programs is not supported in the WebGL 2 API.
2334 This includes OpenGL ES 3.0 <code>GetProgramBinary</code>, <code>ProgramBinary</code>, and
2335 <code>ProgramParameteri</code> entry points. In addition, querying the program binary length with
2336 <code>getProgramParameter</code>, and querying program binary formats with <code>getParameter</code>
2337 are not supported in the WebGL 2 API.
2340 <h3><a name="RANGE_CHECKING">Range Checking</a></h3>
2343 In addition to the range checking specified in the WebGL 1.0 specification section
2344 <a href="../1.0/#ATTRIBS_AND_RANGE_CHECKING">Enabled Vertex Attributes and Range Checking</a>,
2345 indices referenced by <code>drawElements</code>, <code>drawRangeElements</code> or
2346 <code>drawElementsInstanced</code> that are greater than the <code>MAX_ELEMENT_INDEX</code> parameter
2347 cause the draw call to generate an <code>INVALID_OPERATION</code> error even if they lie within the
2348 storage of the bound buffer. Range checking is not performed for indices that trigger primitive
2349 restart if primitive restart is enabled. The range checking specified for <code>drawArrays</code> in
2350 the WebGL 1.0 API is also applied to <code>drawArraysInstanced</code> in the WebGL 2.0 API.
2353 <h3><a name="ENABLED_ATTRIBUTE">Enabled Attribute</a></h3>
2356 In the WebGL 2 API, attempting to draw with <code>drawArrays</code>, <code>drawElements</code>,
2357 <code>drawRangeElements</code> or their instanced variants generates an <code>INVALID_OPERATION</code>
2358 error if there is not at least one enabled vertex attribute array that has a divisor of zero and is
2359 bound to an active generic attribute value in the program used for the draw command.
2362 <h3><a name="ACTIVE_UNIFORM_BLOCK_BACKING">Active Uniform Block Backing</a></h3>
2365 In the WebGL 2 API, attempting to draw with <code>drawArrays</code>, <code>drawElements</code>,
2366 <code>drawRangeElements</code> or their instanced variants generates an <code>INVALID_OPERATION</code>
2367 error if any active uniform block in the program used for the draw command is not backed by a
2368 sufficiently large buffer object.
2371 <h3>Default Framebuffer</h3>
2374 WebGL always has a default framebuffer. The <code>FRAMEBUFFER_UNDEFINED</code> enumerant is removed
2375 from the WebGL 2 API.
2378 <h3><a name="STRING_LENGTH_QUERIES">String Length Queries</a></h3>
2381 In the WebGL 2 API, the enumerants <code>ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH</code>,
2382 <code>TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH</code>, <code>UNIFORM_BLOCK_NAME_LENGTH</code>, and
2383 <code>UNIFORM_NAME_LENGTH</code> are removed in addition to similar
2384 <a href="../1.0/#STRING_LENGTH_QUERIES">enumerants removed in the WebGL 1.0 API</a>.
2387 <h3>Invalid Clears</h3>
2390 In the WebGL 2 API, trying to perform a clear when there is a mismatch between the type of the
2391 specified clear value and the type of a buffer that is being cleared generates an
2392 <code>INVALID_OPERATION</code> error instead of producing undefined results.
2395 <h3>Clamping Texture Offsets</h3>
2398 All texture offset values passed to texture lookup functions in GLSL are clamped to the range
2399 between the implementation-defined parameters <code>MIN_PROGRAM_TEXEL_OFFSET</code> and
2400 <code>MAX_PROGRAM_TEXEL_OFFSET</code> inclusive.
2403 <h3>Texel Fetches</h3>
2406 Texel fetches that have undefined results in the OpenGL ES 3.0 API must return zero, or a texture
2407 source color of (0, 0, 0, 1) in the case of a texel fetch from an incomplete texture in the WebGL 2
2411 <h3>GLSL ES 1.00 Fragment Shader Output</h3>
2414 A fragment shader written in The OpenGL ES Shading Language, Version 1.00, that statically assigns a
2415 value to <code>gl_FragData[n]</code> where <code>n</code> does not equal constant value 0 must fail
2416 to compile in the WebGL 2 API. This is to achieve consistency with The OpenGL ES 3.0 specification
2417 section 4.2.1 <span class="gl-spec">(<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>)</span>
2418 and The OpenGL ES Shading Language 3.00 specification section 1.5 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/3.0/GLSL_ES_Specification_3.00.3.pdf#nameddest=section-1.5">GLSL ES 3.00 §1.5</a>)</span>.
2419 As in the OpenGL ES 3.0 API, multiple fragment shader outputs are only supported for GLSL ES 3.00
2420 shaders in the WebGL 2 API.
2423 <h3>No MapBufferRange</h3>
2426 The <code>MapBufferRange</code>, <code>FlushMappedBufferRange</code>, and <code>UnmapBuffer</code>
2427 entry points are removed from the WebGL 2.0 API. The following enum values are also removed:
2428 <code>BUFFER_ACCESS_FLAGS</code>, <code>BUFFER_MAP_LENGTH</code>, and <code>BUFFER_MAP_OFFSET</code>.
2432 Instead of using <code>MapBufferRange</code>, buffer data may be read by using the
2433 <code>getBufferSubData</code> entry point.
2436 <h3><a name="CLIENT_WAIT_SYNC">clientWaitSync</a></h3>
2438 In the WebGL 2.0 API, WebGL implementations must enforce a short maximum timeout on calls to clientWaitSync in
2439 order to avoid blocking execution of the main thread for excessive periods of time.
2442 The implementation-defined maximum timeout is not specified. It is acceptable for an implementation to enforce a
2443 zero maximum timeout.
2446 <h3><a name="VERTEX_ATTRIBUTE_ALIASING">Vertex Attribute Aliasing</a></h3>
2448 In the WebGL 2.0 API, if more than one active attribute name is bound to the same location, it is considered
2449 aliased, regardless whether there exists a path through the shader that consumes more than of these
2450 attributes. Such definition of aliasing is broader than what is defined in
2451 <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.5">OpenGL ES 3.0.3 §2.11.5</a>)</span>.
2454 A link error is required when aliasing exists.
2457 <!-- ======================================================================================================= -->
2461 <h3>Normative references</h3>
2463 <dt id="refsWEBGL10">[WEBGL10]</dt>
2464 <dd><cite><a href="http://www.khronos.org/registry/webgl/specs/1.0/">
2465 WebGL Specification 1.0.2</a></cite>,
2468 <dt id="refsGLES30">[GLES30]</dt>
2469 <dd><cite><a href="http://www.khronos.org/registry/gles/specs/3.0/es_spec_3.0.3.pdf">
2470 OpenGL® ES Version 3.0.3</a></cite>,
2473 <dt id="refsGLES30GLSL">[GLES30GLSL]</dt>
2474 <dd><cite><a href="http://www.khronos.org/registry/gles/specs/3.0/GLSL_ES_Specification_3.00.4.pdf">
2475 The OpenGL® ES Shading Language Version 3.00</a></cite>,
2476 R. Simpson, March 2013.
2478 <dt id="refsREGISTRY">[REGISTRY]</dt>
2479 <dd><cite><a href="http://www.khronos.org/registry/webgl/extensions/">
2480 WebGL Extension Registry</a></cite>
2482 <dt id="refsRFC2119">[RFC2119]</dt>
2483 <dd><cite><a href="http://www.ietf.org/rfc/rfc2119.txt">
2484 Key words for use in RFCs to Indicate Requirement Levels</a></cite>,
2485 S. Bradner. IETF, March 1997.
2487 <dt id="refsWEBIDL">[WEBIDL]</dt>
2488 <dd><cite><a href="http://dev.w3.org/2006/webapi/WebIDL/">
2489 Web IDL: W3C Editor’s Draft</a></cite>,