Khronos

WebGL

WebGL 2 Specification

Editor's Draft 10 April 2014

This version:
https://www.khronos.org/registry/webgl/specs/latest/2.0/
WebIDL: https://www.khronos.org/registry/webgl/specs/latest/2.0/webgl2.idl
Latest version:
https://www.khronos.org/registry/webgl/specs/latest/2.0/
WebIDL: https://www.khronos.org/registry/webgl/specs/latest/2.0/webgl2.idl
Previous version:
https://www.khronos.org/registry/webgl/specs/1.0.2/
WebIDL: https://www.khronos.org/registry/webgl/specs/1.0.2/webgl.idl
Editor:
Dean Jackson (Apple Inc.)
Copyright © 2013 Khronos Group

Abstract

This is Version 2.0 of the WebGL Specification.

This specification describes an additional rendering context and support objects for the HTML 5 canvas element [CANVAS]. This context allows rendering using an API that conforms closely to the OpenGL ES 3.0 API.

This document should be read as an extension to the WebGL 1.0 specification. It will only describe the differences from 1.0.

Status of this document

This document is an editor's draft. Do not cite this document as other than work in progress. Public discussion of this specification is welcome on the (archived) WebGL mailing list public_webgl@khronos.org (see instructions).

Table of contents

Introduction

WebGL™ is an immediate mode 3D rendering API designed for the web. This is Version 2 of the WebGL specification. It is derived from OpenGL® ES 3.0, and provides similar rendering functionality, but in an HTML context.

WebGL 2 is backwards compatible with WebGL 1: existing content will run in WebGL 2 without modification. To access the new behavior provided in this specification, the content explicitly requests a new context (details below).

Conventions

Many functions described in this document contain links to OpenGL ES man pages. While every effort is made to make these pages match the OpenGL ES 3.0 specification [GLES30], they may contain errors. In the case of a contradiction, the OpenGL ES 3.0 specification is the final authority.

The remaining sections of this document are intended to be read in conjunction with the OpenGL ES 3.0 specification (3.0.2 at the time of this writing, available from the Khronos OpenGL ES API Registry). Unless otherwise specified, the behavior of each method is defined by the OpenGL ES 3.0 specification. This specification may diverge from OpenGL ES 3.0 in order to ensure interoperability or security, often defining areas that OpenGL ES 3.0 leaves implementation-defined. These differences are summarized in the Differences Between WebGL and OpenGL ES 3.0 section.

Context Creation and Drawing Buffer Presentation

Before using the WebGL API, the author must obtain a WebGLRenderingContext object for a given HTMLCanvasElement [CANVAS] as described below. This object is used to manage OpenGL state and render to the drawing buffer, which must be created at the time of context creation.

Context Creation

Each WebGLRenderingContext and WebGL2RenderingContext has an associated canvas, set upon creation, which is a canvas [CANVAS].

Each WebGLRenderingContext and WebGL2RenderingContext has context creation parameters, set upon creation, in a WebGLContextAttributes object.

Each WebGLRenderingContext and WebGL2RenderingContext has actual context parameters, set each time the drawing buffer is created, in a WebGLContextAttributes object.

Each WebGLRenderingContext and WebGL2RenderingContext has a webgl context lost flag, which is initially unset.

When the getContext() method of a canvas element is to return a new object for the contextId webgl2 [CANVASCONTEXTS], the user agent must perform the following steps:

  1. Create a new WebGL2RenderingContext object, context.
  2. Let context's canvas be the canvas the getContext() method is associated with.
  3. Create a new WebGLContextAttributes object, contextAttributes.
  4. If getContext() was invoked with a second argument, options, set the attributes of contextAttributes from those specified in options.
  5. Create a drawing buffer using the settings specified in contextAttributes, and associate the drawing buffer with context.
  6. If drawing buffer creation failed, perform the following steps:
    1. Fire a WebGL context creation error at canvas.
    2. Return null and terminate these steps.
  7. Set the attributes of contextAttributes based on the properties of the newly created drawing buffer.
  8. Set context's context creation parameters to contextAttributes.
  9. Return context.

DOM Interfaces

This section describes the interfaces and functionality added to the DOM to support runtime access to the functionality described above.

Types

The following types are introduced in WebGL 2.0.

typedef long long GLint64;
typedef unsigned long long GLuint64;

WebGLQuery

interface WebGLQuery : WebGLObject {
};

WebGLSampler

interface WebGLSampler : WebGLObject {
};

WebGLSync

interface WebGLSync : WebGLObject {
};

WebGLTransformFeedback

interface WebGLTransformFeedback : WebGLObject {
};

WebGLVertexArrayObject

interface WebGLVertexArrayObject : WebGLObject {
};

The WebGL context

The WebGL2RenderingContext represents the API allowing OpenGL ES 3.0 style rendering into the canvas element.

[NoInterfaceObject]
interface WebGL2RenderingContextBase
{
  const GLenum READ_BUFFER                                   = 0x0C02;
  const GLenum UNPACK_ROW_LENGTH                             = 0x0CF2;
  const GLenum UNPACK_SKIP_ROWS                              = 0x0CF3;
  const GLenum UNPACK_SKIP_PIXELS                            = 0x0CF4;
  const GLenum PACK_ROW_LENGTH                               = 0x0D02;
  const GLenum PACK_SKIP_ROWS                                = 0x0D03;
  const GLenum PACK_SKIP_PIXELS                              = 0x0D04;
  const GLenum COLOR                                         = 0x1800;
  const GLenum DEPTH                                         = 0x1801;
  const GLenum STENCIL                                       = 0x1802;
  const GLenum RED                                           = 0x1903;
  const GLenum RGB8                                          = 0x8051;
  const GLenum RGBA8                                         = 0x8058;
  const GLenum RGB10_A2                                      = 0x8059;
  const GLenum TEXTURE_BINDING_3D                            = 0x806A;
  const GLenum UNPACK_SKIP_IMAGES                            = 0x806D;
  const GLenum UNPACK_IMAGE_HEIGHT                           = 0x806E;
  const GLenum TEXTURE_3D                                    = 0x806F;
  const GLenum TEXTURE_WRAP_R                                = 0x8072;
  const GLenum MAX_3D_TEXTURE_SIZE                           = 0x8073;
  const GLenum UNSIGNED_INT_2_10_10_10_REV                   = 0x8368;
  const GLenum MAX_ELEMENTS_VERTICES                         = 0x80E8;
  const GLenum MAX_ELEMENTS_INDICES                          = 0x80E9;
  const GLenum TEXTURE_MIN_LOD                               = 0x813A;
  const GLenum TEXTURE_MAX_LOD                               = 0x813B;
  const GLenum TEXTURE_BASE_LEVEL                            = 0x813C;
  const GLenum TEXTURE_MAX_LEVEL                             = 0x813D;
  const GLenum MIN                                           = 0x8007;
  const GLenum MAX                                           = 0x8008;
  const GLenum DEPTH_COMPONENT24                             = 0x81A6;
  const GLenum MAX_TEXTURE_LOD_BIAS                          = 0x84FD;
  const GLenum TEXTURE_COMPARE_MODE                          = 0x884C;
  const GLenum TEXTURE_COMPARE_FUNC                          = 0x884D;
  const GLenum CURRENT_QUERY                                 = 0x8865;
  const GLenum QUERY_RESULT                                  = 0x8866;
  const GLenum QUERY_RESULT_AVAILABLE                        = 0x8867;
  const GLenum BUFFER_MAPPED                                 = 0x88BC; /* TODO: Depends on mapBufferRange */
  const GLenum BUFFER_MAP_POINTER                            = 0x88BD; /* TODO: Depends on mapBufferRange */
  const GLenum STREAM_READ                                   = 0x88E1;
  const GLenum STREAM_COPY                                   = 0x88E2;
  const GLenum STATIC_READ                                   = 0x88E5;
  const GLenum STATIC_COPY                                   = 0x88E6;
  const GLenum DYNAMIC_READ                                  = 0x88E9;
  const GLenum DYNAMIC_COPY                                  = 0x88EA;
  const GLenum MAX_DRAW_BUFFERS                              = 0x8824;
  const GLenum DRAW_BUFFER0                                  = 0x8825;
  const GLenum DRAW_BUFFER1                                  = 0x8826;
  const GLenum DRAW_BUFFER2                                  = 0x8827;
  const GLenum DRAW_BUFFER3                                  = 0x8828;
  const GLenum DRAW_BUFFER4                                  = 0x8829;
  const GLenum DRAW_BUFFER5                                  = 0x882A;
  const GLenum DRAW_BUFFER6                                  = 0x882B;
  const GLenum DRAW_BUFFER7                                  = 0x882C;
  const GLenum DRAW_BUFFER8                                  = 0x882D;
  const GLenum DRAW_BUFFER9                                  = 0x882E;
  const GLenum DRAW_BUFFER10                                 = 0x882F;
  const GLenum DRAW_BUFFER11                                 = 0x8830;
  const GLenum DRAW_BUFFER12                                 = 0x8831;
  const GLenum DRAW_BUFFER13                                 = 0x8832;
  const GLenum DRAW_BUFFER14                                 = 0x8833;
  const GLenum DRAW_BUFFER15                                 = 0x8834;
  const GLenum MAX_FRAGMENT_UNIFORM_COMPONENTS               = 0x8B49;
  const GLenum MAX_VERTEX_UNIFORM_COMPONENTS                 = 0x8B4A;
  const GLenum SAMPLER_3D                                    = 0x8B5F;
  const GLenum SAMPLER_2D_SHADOW                             = 0x8B62;
  const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT               = 0x8B8B;
  const GLenum PIXEL_PACK_BUFFER                             = 0x88EB;
  const GLenum PIXEL_UNPACK_BUFFER                           = 0x88EC;
  const GLenum PIXEL_PACK_BUFFER_BINDING                     = 0x88ED;
  const GLenum PIXEL_UNPACK_BUFFER_BINDING                   = 0x88EF;
  const GLenum FLOAT_MAT2x3                                  = 0x8B65;
  const GLenum FLOAT_MAT2x4                                  = 0x8B66;
  const GLenum FLOAT_MAT3x2                                  = 0x8B67;
  const GLenum FLOAT_MAT3x4                                  = 0x8B68;
  const GLenum FLOAT_MAT4x2                                  = 0x8B69;
  const GLenum FLOAT_MAT4x3                                  = 0x8B6A;
  const GLenum SRGB                                          = 0x8C40;
  const GLenum SRGB8                                         = 0x8C41;
  const GLenum SRGB8_ALPHA8                                  = 0x8C43;
  const GLenum COMPARE_REF_TO_TEXTURE                        = 0x884E;
  const GLenum RGBA32F                                       = 0x8814;
  const GLenum RGB32F                                        = 0x8815;
  const GLenum RGBA16F                                       = 0x881A;
  const GLenum RGB16F                                        = 0x881B;
  const GLenum VERTEX_ATTRIB_ARRAY_INTEGER                   = 0x88FD;
  const GLenum MAX_ARRAY_TEXTURE_LAYERS                      = 0x88FF;
  const GLenum MIN_PROGRAM_TEXEL_OFFSET                      = 0x8904;
  const GLenum MAX_PROGRAM_TEXEL_OFFSET                      = 0x8905;
  const GLenum MAX_VARYING_COMPONENTS                        = 0x8B4B;
  const GLenum TEXTURE_2D_ARRAY                              = 0x8C1A;
  const GLenum TEXTURE_BINDING_2D_ARRAY                      = 0x8C1D;
  const GLenum R11F_G11F_B10F                                = 0x8C3A;
  const GLenum UNSIGNED_INT_10F_11F_11F_REV                  = 0x8C3B;
  const GLenum RGB9_E5                                       = 0x8C3D;
  const GLenum UNSIGNED_INT_5_9_9_9_REV                      = 0x8C3E;
  const GLenum TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH         = 0x8C76;
  const GLenum TRANSFORM_FEEDBACK_BUFFER_MODE                = 0x8C7F;
  const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS    = 0x8C80;
  const GLenum TRANSFORM_FEEDBACK_VARYINGS                   = 0x8C83;
  const GLenum TRANSFORM_FEEDBACK_BUFFER_START               = 0x8C84;
  const GLenum TRANSFORM_FEEDBACK_BUFFER_SIZE                = 0x8C85;
  const GLenum TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN         = 0x8C88;
  const GLenum RASTERIZER_DISCARD                            = 0x8C89;
  const GLenum MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A;
  const GLenum MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS       = 0x8C8B;
  const GLenum INTERLEAVED_ATTRIBS                           = 0x8C8C;
  const GLenum SEPARATE_ATTRIBS                              = 0x8C8D;
  const GLenum TRANSFORM_FEEDBACK_BUFFER                     = 0x8C8E;
  const GLenum TRANSFORM_FEEDBACK_BUFFER_BINDING             = 0x8C8F;
  const GLenum RGBA32UI                                      = 0x8D70;
  const GLenum RGB32UI                                       = 0x8D71;
  const GLenum RGBA16UI                                      = 0x8D76;
  const GLenum RGB16UI                                       = 0x8D77;
  const GLenum RGBA8UI                                       = 0x8D7C;
  const GLenum RGB8UI                                        = 0x8D7D;
  const GLenum RGBA32I                                       = 0x8D82;
  const GLenum RGB32I                                        = 0x8D83;
  const GLenum RGBA16I                                       = 0x8D88;
  const GLenum RGB16I                                        = 0x8D89;
  const GLenum RGBA8I                                        = 0x8D8E;
  const GLenum RGB8I                                         = 0x8D8F;
  const GLenum RED_INTEGER                                   = 0x8D94;
  const GLenum RGB_INTEGER                                   = 0x8D98;
  const GLenum RGBA_INTEGER                                  = 0x8D99;
  const GLenum SAMPLER_2D_ARRAY                              = 0x8DC1;
  const GLenum SAMPLER_2D_ARRAY_SHADOW                       = 0x8DC4;
  const GLenum SAMPLER_CUBE_SHADOW                           = 0x8DC5;
  const GLenum UNSIGNED_INT_VEC2                             = 0x8DC6;
  const GLenum UNSIGNED_INT_VEC3                             = 0x8DC7;
  const GLenum UNSIGNED_INT_VEC4                             = 0x8DC8;
  const GLenum INT_SAMPLER_2D                                = 0x8DCA;
  const GLenum INT_SAMPLER_3D                                = 0x8DCB;
  const GLenum INT_SAMPLER_CUBE                              = 0x8DCC;
  const GLenum INT_SAMPLER_2D_ARRAY                          = 0x8DCF;
  const GLenum UNSIGNED_INT_SAMPLER_2D                       = 0x8DD2;
  const GLenum UNSIGNED_INT_SAMPLER_3D                       = 0x8DD3;
  const GLenum UNSIGNED_INT_SAMPLER_CUBE                     = 0x8DD4;
  const GLenum UNSIGNED_INT_SAMPLER_2D_ARRAY                 = 0x8DD7;
  // const GLenum BUFFER_ACCESS_FLAGS                           = 0x911F; /* TODO: Depends on mapBufferRange */
  // const GLenum BUFFER_MAP_LENGTH                             = 0x9120; /* TODO: Depends on mapBufferRange */
  // const GLenum BUFFER_MAP_OFFSET                             = 0x9121; /* TODO: Depends on mapBufferRange */
  const GLenum DEPTH_COMPONENT32F                            = 0x8CAC;
  const GLenum DEPTH32F_STENCIL8                             = 0x8CAD;
  const GLenum FLOAT_32_UNSIGNED_INT_24_8_REV                = 0x8DAD;
  const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING         = 0x8210;
  const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE         = 0x8211;
  const GLenum FRAMEBUFFER_ATTACHMENT_RED_SIZE               = 0x8212;
  const GLenum FRAMEBUFFER_ATTACHMENT_GREEN_SIZE             = 0x8213;
  const GLenum FRAMEBUFFER_ATTACHMENT_BLUE_SIZE              = 0x8214;
  const GLenum FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE             = 0x8215;
  const GLenum FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE             = 0x8216;
  const GLenum FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE           = 0x8217;
  const GLenum FRAMEBUFFER_DEFAULT                           = 0x8218;
  const GLenum FRAMEBUFFER_UNDEFINED                         = 0x8219;
  const GLenum DEPTH_STENCIL_ATTACHMENT                      = 0x821A;
  const GLenum DEPTH_STENCIL                                 = 0x84F9;
  const GLenum UNSIGNED_INT_24_8                             = 0x84FA;
  const GLenum DEPTH24_STENCIL8                              = 0x88F0;
  const GLenum UNSIGNED_NORMALIZED                           = 0x8C17;
  const GLenum DRAW_FRAMEBUFFER_BINDING                      = 0x8CA6; /* Same as FRAMEBUFFER_BINDING */
  const GLenum READ_FRAMEBUFFER                              = 0x8CA8;
  const GLenum DRAW_FRAMEBUFFER                              = 0x8CA9;
  const GLenum READ_FRAMEBUFFER_BINDING                      = 0x8CAA;
  const GLenum RENDERBUFFER_SAMPLES                          = 0x8CAB;
  const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER          = 0x8CD4;
  const GLenum MAX_COLOR_ATTACHMENTS                         = 0x8CDF;
  const GLenum COLOR_ATTACHMENT1                             = 0x8CE1;
  const GLenum COLOR_ATTACHMENT2                             = 0x8CE2;
  const GLenum COLOR_ATTACHMENT3                             = 0x8CE3;
  const GLenum COLOR_ATTACHMENT4                             = 0x8CE4;
  const GLenum COLOR_ATTACHMENT5                             = 0x8CE5;
  const GLenum COLOR_ATTACHMENT6                             = 0x8CE6;
  const GLenum COLOR_ATTACHMENT7                             = 0x8CE7;
  const GLenum COLOR_ATTACHMENT8                             = 0x8CE8;
  const GLenum COLOR_ATTACHMENT9                             = 0x8CE9;
  const GLenum COLOR_ATTACHMENT10                            = 0x8CEA;
  const GLenum COLOR_ATTACHMENT11                            = 0x8CEB;
  const GLenum COLOR_ATTACHMENT12                            = 0x8CEC;
  const GLenum COLOR_ATTACHMENT13                            = 0x8CED;
  const GLenum COLOR_ATTACHMENT14                            = 0x8CEE;
  const GLenum COLOR_ATTACHMENT15                            = 0x8CEF;
  const GLenum FRAMEBUFFER_INCOMPLETE_MULTISAMPLE            = 0x8D56;
  const GLenum MAX_SAMPLES                                   = 0x8D57;
  const GLenum HALF_FLOAT                                    = 0x140B;
  // const GLenum MAP_READ_BIT                                  = 0x0001; /* TODO: Depends on mapBufferRange */
  // const GLenum MAP_WRITE_BIT                                 = 0x0002; /* TODO: Depends on mapBufferRange */
  // const GLenum MAP_INVALIDATE_RANGE_BIT                      = 0x0004; /* TODO: Depends on mapBufferRange */
  // const GLenum MAP_INVALIDATE_BUFFER_BIT                     = 0x0008; /* TODO: Depends on mapBufferRange */
  // const GLenum MAP_FLUSH_EXPLICIT_BIT                        = 0x0010; /* TODO: Depends on mapBufferRange */
  // const GLenum MAP_UNSYNCHRONIZED_BIT                        = 0x0020; /* TODO: Depends on mapBufferRange */
  const GLenum RG                                            = 0x8227;
  const GLenum RG_INTEGER                                    = 0x8228;
  const GLenum R8                                            = 0x8229;
  const GLenum RG8                                           = 0x822B;
  const GLenum R16F                                          = 0x822D;
  const GLenum R32F                                          = 0x822E;
  const GLenum RG16F                                         = 0x822F;
  const GLenum RG32F                                         = 0x8230;
  const GLenum R8I                                           = 0x8231;
  const GLenum R8UI                                          = 0x8232;
  const GLenum R16I                                          = 0x8233;
  const GLenum R16UI                                         = 0x8234;
  const GLenum R32I                                          = 0x8235;
  const GLenum R32UI                                         = 0x8236;
  const GLenum RG8I                                          = 0x8237;
  const GLenum RG8UI                                         = 0x8238;
  const GLenum RG16I                                         = 0x8239;
  const GLenum RG16UI                                        = 0x823A;
  const GLenum RG32I                                         = 0x823B;
  const GLenum RG32UI                                        = 0x823C;
  const GLenum VERTEX_ARRAY_BINDING                          = 0x85B5;
  const GLenum R8_SNORM                                      = 0x8F94;
  const GLenum RG8_SNORM                                     = 0x8F95;
  const GLenum RGB8_SNORM                                    = 0x8F96;
  const GLenum RGBA8_SNORM                                   = 0x8F97;
  const GLenum SIGNED_NORMALIZED                             = 0x8F9C;
  const GLenum PRIMITIVE_RESTART_FIXED_INDEX                 = 0x8D69;
  const GLenum COPY_READ_BUFFER                              = 0x8F36;
  const GLenum COPY_WRITE_BUFFER                             = 0x8F37;
  const GLenum COPY_READ_BUFFER_BINDING                      = 0x8F36; /* Same as COPY_READ_BUFFER */
  const GLenum COPY_WRITE_BUFFER_BINDING                     = 0x8F37; /* Same as COPY_WRITE_BUFFER */
  const GLenum UNIFORM_BUFFER                                = 0x8A11;
  const GLenum UNIFORM_BUFFER_BINDING                        = 0x8A28;
  const GLenum UNIFORM_BUFFER_START                          = 0x8A29;
  const GLenum UNIFORM_BUFFER_SIZE                           = 0x8A2A;
  const GLenum MAX_VERTEX_UNIFORM_BLOCKS                     = 0x8A2B;
  const GLenum MAX_FRAGMENT_UNIFORM_BLOCKS                   = 0x8A2D;
  const GLenum MAX_COMBINED_UNIFORM_BLOCKS                   = 0x8A2E;
  const GLenum MAX_UNIFORM_BUFFER_BINDINGS                   = 0x8A2F;
  const GLenum MAX_UNIFORM_BLOCK_SIZE                        = 0x8A30;
  const GLenum MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS        = 0x8A31;
  const GLenum MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS      = 0x8A33;
  const GLenum UNIFORM_BUFFER_OFFSET_ALIGNMENT               = 0x8A34;
  const GLenum ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH          = 0x8A35;
  const GLenum ACTIVE_UNIFORM_BLOCKS                         = 0x8A36;
  const GLenum UNIFORM_TYPE                                  = 0x8A37;
  const GLenum UNIFORM_SIZE                                  = 0x8A38;
  const GLenum UNIFORM_NAME_LENGTH                           = 0x8A39;
  const GLenum UNIFORM_BLOCK_INDEX                           = 0x8A3A;
  const GLenum UNIFORM_OFFSET                                = 0x8A3B;
  const GLenum UNIFORM_ARRAY_STRIDE                          = 0x8A3C;
  const GLenum UNIFORM_MATRIX_STRIDE                         = 0x8A3D;
  const GLenum UNIFORM_IS_ROW_MAJOR                          = 0x8A3E;
  const GLenum UNIFORM_BLOCK_BINDING                         = 0x8A3F;
  const GLenum UNIFORM_BLOCK_DATA_SIZE                       = 0x8A40;
  const GLenum UNIFORM_BLOCK_NAME_LENGTH                     = 0x8A41;
  const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORMS                 = 0x8A42;
  const GLenum UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES          = 0x8A43;
  const GLenum UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER     = 0x8A44;
  const GLenum UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER   = 0x8A46;
  const GLenum INVALID_INDEX                                 = 0xFFFFFFFF;
  const GLenum MAX_VERTEX_OUTPUT_COMPONENTS                  = 0x9122;
  const GLenum MAX_FRAGMENT_INPUT_COMPONENTS                 = 0x9125;
  const GLenum MAX_SERVER_WAIT_TIMEOUT                       = 0x9111;
  const GLenum OBJECT_TYPE                                   = 0x9112;
  const GLenum SYNC_CONDITION                                = 0x9113;
  const GLenum SYNC_STATUS                                   = 0x9114;
  const GLenum SYNC_FLAGS                                    = 0x9115;
  const GLenum SYNC_FENCE                                    = 0x9116;
  const GLenum SYNC_GPU_COMMANDS_COMPLETE                    = 0x9117;
  const GLenum UNSIGNALED                                    = 0x9118;
  const GLenum SIGNALED                                      = 0x9119;
  const GLenum ALREADY_SIGNALED                              = 0x911A;
  const GLenum TIMEOUT_EXPIRED                               = 0x911B;
  const GLenum CONDITION_SATISFIED                           = 0x911C;
  const GLenum WAIT_FAILED                                   = 0x911D;
  const GLenum SYNC_FLUSH_COMMANDS_BIT                       = 0x00000001;
  const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR                   = 0x88FE;
  const GLenum ANY_SAMPLES_PASSED                            = 0x8C2F;
  const GLenum ANY_SAMPLES_PASSED_CONSERVATIVE               = 0x8D6A;
  const GLenum SAMPLER_BINDING                               = 0x8919;
  const GLenum RGB10_A2UI                                    = 0x906F;
  const GLenum TEXTURE_SWIZZLE_R                             = 0x8E42;
  const GLenum TEXTURE_SWIZZLE_G                             = 0x8E43;
  const GLenum TEXTURE_SWIZZLE_B                             = 0x8E44;
  const GLenum TEXTURE_SWIZZLE_A                             = 0x8E45;
  const GLenum GREEN                                         = 0x1904;
  const GLenum BLUE                                          = 0x1905;
  const GLenum INT_2_10_10_10_REV                            = 0x8D9F;
  const GLenum TRANSFORM_FEEDBACK                            = 0x8E22;
  const GLenum TRANSFORM_FEEDBACK_PAUSED                     = 0x8E23;
  const GLenum TRANSFORM_FEEDBACK_ACTIVE                     = 0x8E24;
  const GLenum TRANSFORM_FEEDBACK_BINDING                    = 0x8E25;
  const GLenum COMPRESSED_R11_EAC                            = 0x9270;
  const GLenum COMPRESSED_SIGNED_R11_EAC                     = 0x9271;
  const GLenum COMPRESSED_RG11_EAC                           = 0x9272;
  const GLenum COMPRESSED_SIGNED_RG11_EAC                    = 0x9273;
  const GLenum COMPRESSED_RGB8_ETC2                          = 0x9274;
  const GLenum COMPRESSED_SRGB8_ETC2                         = 0x9275;
  const GLenum COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2      = 0x9276;
  const GLenum COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2     = 0x9277;
  const GLenum COMPRESSED_RGBA8_ETC2_EAC                     = 0x9278;
  const GLenum COMPRESSED_SRGB8_ALPHA8_ETC2_EAC              = 0x9279;
  const GLenum TEXTURE_IMMUTABLE_FORMAT                      = 0x912F;
  const GLenum MAX_ELEMENT_INDEX                             = 0x8D6B;
  const GLenum NUM_SAMPLE_COUNTS                             = 0x9380;
  const GLenum TEXTURE_IMMUTABLE_LEVELS                      = 0x82DF;

  const GLuint64 TIMEOUT_IGNORED                             = 0xFFFFFFFFFFFFFFFF;

  /* Buffer objects */
  void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);

  /* Framebuffer objects */
  void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
  void framebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
  any getInternalformatParameter(GLenum target, GLenum internalformat, GLenum pname);
  void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments);
  void invalidateSubFramebuffer (GLenum target, sequence<GLenum> attachments, GLint x, GLint y, GLsizei width, GLsizei height);
  void readBuffer(GLenum mode);
  void renderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);

  /* Texture objects */
  void texStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
  void texStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
  void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, ArrayBufferView? pixels);
  void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, ImageData? data);
  void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, HTMLImageElement image);
  void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, HTMLCanvasElement canvas);
  void texSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, HTMLVideoElement video);
  void copyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
  void compressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, ArrayBufferView data);
  void compressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, ArrayBufferView data);

  /* Programs and shaders */
  [WebGLHandlesContextLoss] GLint getFragDataLocation(WebGLProgram? program, DOMString name);

  /* Uniforms and attributes */
  void vertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset);

  /* TODO: these will have to be exposed differently -- for example,
     by changing the return type of getVertexAttrib based on the
     most recently set type for the vertex attrib */
  // void glGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params);
  // void glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params);

  void uniform1ui(WebGLUniformLocation? location, GLuint v0);
  void uniform2ui(WebGLUniformLocation? location, GLuint v0, GLuint v1);
  void uniform3ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2);
  void uniform4ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
  void uniform1uiv(WebGLUniformLocation? location, sequence<GLuint> value);
  void uniform2uiv(WebGLUniformLocation? location, sequence<GLuint> value);
  void uniform3uiv(WebGLUniformLocation? location, sequence<GLuint> value);
  void uniform4uiv(WebGLUniformLocation? location, sequence<GLuint> value);
  void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
  void uniformMatrix2x3fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
  void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
  void uniformMatrix3x2fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
  void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
  void uniformMatrix2x4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
  void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
  void uniformMatrix4x2fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
  void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
  void uniformMatrix3x4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
  void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array value);
  void uniformMatrix4x3fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> value);
  /* TODO: this will be exposed as a couple of additional entries in
     the return type table for getUniform */
  // void glGetUniformuiv (GLuint program, GLint location, GLuint* params);
  void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
  void vertexAttribI4iv(GLuint index, sequence<GLint> v);
  void vertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
  void vertexAttribI4uiv(GLuint index, sequence<GLuint> v);

  /* Writing to the drawing buffer */
  void vertexAttribDivisor(GLuint index, GLuint divisor);
  void drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount);
  void drawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount);
  /* TODO(kbr): argue against exposing this because it can't safely
     offer better performance than drawElements */
  void drawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLintptr offset);

  /* Multiple Render Targets */
  void drawBuffers(sequence<GLenum> buffers);
  void clearBufferiv(GLenum buffer, GLint drawbuffer, Int32Array value);
  void clearBufferiv(GLenum buffer, GLint drawbuffer, sequence<GLint> value);
  void clearBufferuiv(GLenum buffer, GLint drawbuffer, Uint32Array value);
  void clearBufferuiv(GLenum buffer, GLint drawbuffer, sequence<GLuint> value);
  void clearBufferfv(GLenum buffer, GLint drawbuffer, Float32Array value);
  void clearBufferfv(GLenum buffer, GLint drawbuffer, sequence<GLfloat> value);
  void clearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil);

  /* Query Objects */
  WebGLQuery? createQuery();
  void deleteQuery(WebGLQuery? query);
  [WebGLHandlesContextLoss] GLboolean isQuery(WebGLQuery? query);
  void beginQuery(GLenum target, WebGLQuery? query);
  void endQuery(GLenum target);
  /* TODO: document return type */
  any getQuery(GLenum target, GLenum pname);
  /* TODO: document return type */
  any getQueryParameter(WebGLQuery? query, GLenum pname);

  /* Sampler Objects */
  WebGLSampler? createSampler();
  void deleteSampler(WebGLSampler? sampler);
  [WebGLHandlesContextLoss] GLboolean isSampler(WebGLSampler? sampler);
  void bindSampler(GLuint unit, WebGLSampler? sampler);
  void samplerParameteri(WebGLSampler? sampler, GLenum pname, GLint param);
  void samplerParameteriv(WebGLSampler? sampler, GLenum pname, Int32Array param);
  void samplerParameteriv(WebGLSampler? sampler, GLenum pname, sequence<GLint> param);
  void samplerParameterf(WebGLSampler? sampler, GLenum pname, GLfloat param);
  void samplerParameterfv(WebGLSampler? sampler, GLenum pname, Float32Array param);
  void samplerParameterfv(WebGLSampler? sampler, GLenum pname, sequence<GLfloat> param);

  /* TODO: document return type */
  any getSamplerParameter(WebGLSampler? sampler, GLenum pname);

  /* Sync objects */
  WebGLSync? fenceSync(GLenum condition, GLbitfield flags);
  GLboolean isSync(WebGLSync? sync);
  void deleteSync(WebGLSync? sync);
  GLenum clientWaitSync(WebGLSync? sync, GLbitfield flags, GLuint64 timeout);
  void waitSync(WebGLSync? sync, GLbitfield flags, GLuint64 timeout);
  /* TODO: document return type */
  any getSyncParameter(WebGLSync? sync, GLenum pname);

  /* Transform Feedback */
  WebGLTransformFeedback? createTransformFeedback();
  void deleteTransformFeedback(WebGLTransformFeedback?);
  [WebGLHandlesContextLoss] GLboolean isTransformFeedback(WebGLTransformFeedback?);
  void bindTransformFeedback (GLenum target, GLuint id);
  void beginTransformFeedback(GLenum primitiveMode);
  void endTransformFeedback();
  void transformFeedbackVaryings(WebGLProgram? program, GLsizei count, sequence<DOMString> varyings, GLenum bufferMode);
  WebGLActiveInfo? getTransformFeedbackVarying(WebGLProgram? program, GLuint index);
  void pauseTransformFeedback();
  void resumeTransformFeedback();

  /* Uniform Buffer Objects and Transform Feedback Buffers */
  void bindBufferBase(GLenum target, GLuint index, WebGLBuffer? buffer);
  void bindBufferRange(GLenum target, GLuint index, WebGLBuffer? buffer, GLintptr offset, GLsizeiptr size);
  any getIndexedParameter(GLenum target, GLuint index);
  sequence<GLuint>? getUniformIndices(WebGLProgram? program, sequence<DOMString> uniformNames);
  sequence<GLint>? getActiveUniforms(WebGLProgram? program, sequence<GLuint> uniformIndices, GLenum pname);
  GLuint getUniformBlockIndex(WebGLProgram? program, DOMString uniformBlockName);
  /* TODO: document return type; make sure unnecessary enums are deleted */
  any getActiveUniformBlockParameter(WebGLProgram? program, GLuint uniformBlockIndex, GLenum pname);
  /* TODO: if there were a fake enum for GL_UNIFORM_BLOCK_NAME, then this could be folded into getActiveUniformBlockParameter */
  DOMString? getActiveUniformBlockName(WebGLProgram? program, GLuint uniformBlockIndex);
  void uniformBlockBinding(WebGLProgram? program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);

  /* Vertex Array Objects */
  WebGLVertexArrayObject? createVertexArray();
  void deleteVertexArray(WebGLVertexArrayObject? vertexArray);
  [WebGLHandlesContextLoss] GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
  void bindVertexArray(WebGLVertexArrayObject? array);

  /* TODO:
   *  - Consider adding getBufferSubData replacing MapBufferRange, etc.
   *  - Figure out what to do about glMapBufferRange, glFlushMappedBufferRange, glUnmapBuffer
   *    - If exposing these, think about glGetBufferPointerv
   *  - Is it necessary to expose glGetInteger64v, glGetInteger64i_v, and glGetBufferParameteri64v?
   *    - Or are they subsumed into other queries' signatures?
   *  - Deliberately not exposing glGetProgramBinary, glProgramBinary, glProgramParameteri
   */
};
WebGL2RenderingContextBase implements WebGLRenderingContextBase;

interface WebGL2RenderingContext
{
};
WebGL2RenderingContext implements WebGL2RenderingContextBase;

Setting and getting state

any getParameter(GLenum pname) (glGet OpenGL ES 3.0 man page) (glGetString OpenGL ES 3.0 man page)
Return the value for the passed pname. As well as supporting all the pname/type values from WebGL 1.0, the following parameters are supported:
pnamereturned type
COPY_READ_BUFFER_BINDINGWebGLBuffer
COPY_WRITE_BUFFER_BINDINGWebGLBuffer
DRAW_BINDINGGLenum
DRAW_FRAMEBUFFER_BINDINGWebGLFramebuffer
FRAGMENT_SHADER_DERIVATIVE_HINTGLenum
IMPLEMENTATION_COLOR_READ_FORMATGLenum
IMPLEMENTATION_COLOR_READ_TYPEGLenum
MAX_3D_TEXTURE_SIZEGLint
MAX_ARRAY_TEXTURE_LAYERSGLint
MAX_COLOR_ATTACHMENTSGLint
MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTSGLint
MAX_COMBINED_UNIFORM_BLOCKSGLint
MAX_COMBINED_VERTEX_UNIFORM_COMPONENTSGLint
MAX_DRAW_BUFFERSGLint
MAX_ELEMENT_INDEXGLint
MAX_ELEMENTS_INDICESGLint
MAX_ELEMENTS_VERTICESGLint
MAX_FRAGMENT_INPUT_COMPONENTSGLint
MAX_FRAGMENT_UNIFORM_BLOCKSGLint
MAX_FRAGMENT_UNIFORM_COMPONENTSGLint
MAX_PROGRAM_TEXEL_OFFSETGLint
MAX_SAMPLESGLint
MAX_SERVER_WAIT_TIMEOUTGLuint64
MAX_TEXTURE_LOD_BIASGLint
MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTSGLint
MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBSGLint
MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTSGLint
MAX_UNIFORM_BLOCK_SIZEGLint
MAX_UNIFORM_BUFFER_BINDINGSGLint
MAX_VARYING_COMPONENTSGLint
MAX_VERTEX_OUTPUT_COMPONENTSGLint
MAX_VERTEX_UNIFORM_BLOCKSGLint
MAX_VERTEX_UNIFORM_COMPONENTSGLint
MIN_PROGRAM_TEXEL_OFFSETGLint
PACK_IMAGE_HEIGHTGLint
PACK_ROW_LENGTHGLint
PACK_SKIP_IMAGESGLint
PACK_SKIP_PIXELSGLint
PACK_SKIP_ROWSGLint
PIXEL_PACK_BUFFER_BINDINGWebGLBuffer
PIXEL_UNPACK_BUFFER_BINDINGWebGLBuffer
PRIMITIVE_RESTART_FIXED_INDEXGLboolean
READ_BUFFERGLenum
READ_FRAMEBUFFER_BINDINGWebGLFramebuffer
SAMPLE_ALPHA_TO_COVERAGEGLboolean
SAMPLE_COVERAGEGLboolean
SAMPLER_BINDINGWebGLSampler
TEXTURE_BINDING_2D_ARRAYWebGLTexture
TEXTURE_BINDING_3DWebGLTexture
TRANSFORM_FEEDBACK_ACTIVEGLboolean
TRANSFORM_FEEDBACK_BUFFER_BINDINGWebGLBuffer
TRANSFORM_FEEDBACK_PAUSEDGLboolean
TRANSFORM_FEEDBACK_BUFFER_SIZEGLint
TRANSFORM_FEEDBACK_BUFFER_STARTGLint
UNIFORM_BUFFER_BINDINGWebGLBuffer
UNIFORM_BUFFER_OFFSET_ALIGNMENTGLint
UNIFORM_BUFFER_SIZEGLint
UNIFORM_BUFFER_STARTGLint
UNPACK_IMAGE_HEIGHTGLint
UNPACK_ROW_LENGTHGLint
UNPACK_SKIP_IMAGESGLboolean
UNPACK_SKIP_PIXELSGLboolean
UNPACK_SKIP_ROWSGLboolean
VERTEX_ARRAY_BINDINGWebGLVertexArrayObject

Buffer objects

void copyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); (OpenGL ES 3.0.2 §2.9.5, man page)

Framebuffer objects

any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, GLenum pname) (OpenGL ES 3.0.2 §6.1.13, similar to glGetFramebufferAttachmentParameteriv)
Return the value for the passed pname given the passed target and attachment. The type returned is the natural type for the requested pname, as given in the following table:
pnamereturned type
FRAMEBUFFER_ATTACHMENT_ALPHA_SIZEGLint
FRAMEBUFFER_ATTACHMENT_BLUE_SIZEGLint
FRAMEBUFFER_ATTACHMENT_COLOR_ENCODINGGenum
FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPEGenum
FRAMEBUFFER_ATTACHMENT_DEPTH_SIZEGLint
FRAMEBUFFER_ATTACHMENT_GREEN_SIZEGLint
FRAMEBUFFER_ATTACHMENT_OBJECT_NAMEWebGLRenderbuffer or WebGLTexture
FRAMEBUFFER_ATTACHMENT_OBJECT_TYPEGLenum
FRAMEBUFFER_ATTACHMENT_RED_SIZEGLint
FRAMEBUFFER_ATTACHMENT_STENCIL_SIZEGLint
FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACEGLint
FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYERGint
FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVELGLint

If pname is not in the table above, generates an INVALID_ENUM error.

If an OpenGL error is generated, returns null.

void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); (OpenGL ES 3.0.2 §4.3.2, man page)

void framebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); (OpenGL ES 3.0.2 §4.4, man page)

any getInternalformatParameter(GLenum target, GLenum internalformat, GLenum pname); (OpenGL ES 3.0.2 §6.1.15, man page)

void invalidateFramebuffer(GLenum target, sequence<GLenum> attachments); (OpenGL ES 3.0.2 §4.5, man page)

void invalidateSubFramebuffer (GLenum target, sequence<GLenum> attachments, GLint x, GLint y, GLsizei width, GLsizei height); (OpenGL ES 3.0.2 §4.5, man page)

void readBuffer(GLenum mode); (OpenGL ES 3.0.2 §4.3.1, man page)

Renderbuffer objects

any getRenderbufferParameter(GLenum target, GLenum pname) (OpenGL ES 2.0 §6.1.14, similar to glGetRenderbufferParameteriv)
Return the value for the passed pname given the passed target. The type returned is the natural type for the requested pname, as given in the following table:
pnamereturned type
RENDERBUFFER_WIDTHGLint
RENDERBUFFER_HEIGHTGLint
RENDERBUFFER_INTERNAL_FORMATGLenum
RENDERBUFFER_RED_SIZEGLint
RENDERBUFFER_GREEN_SIZEGLint
RENDERBUFFER_BLUE_SIZEGLint
RENDERBUFFER_ALPHA_SIZEGLint
RENDERBUFFER_DEPTH_SIZEGLint
RENDERBUFFER_SAMPLESGLint
RENDERBUFFER_STENCIL_SIZEGLint

If pname is not in the table above, generates an INVALID_ENUM error.

If an OpenGL error is generated, returns null.

void renderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); (OpenGL ES 3.0.2 §4.4.2, man page)

Texture objects

any getTexParameter(GLenum target, GLenum pname) (OpenGL ES 3.0.2 §6.1.3, man page)
Return the value for the passed pname given the passed target. The type returned is the natural type for the requested pname, as given in the following table:
pnamereturned type
TEXTURE_BASE_LEVELGLint
TEXTURE_COMPARE_FUNCGLenum
TEXTURE_COMPARE_MODEGLenum
TEXTURE_MAG_FILTERGLenum
TEXTURE_MAX_LEVELGLint
TEXTURE_MAX_LODGLfloat
TEXTURE_MIN_FILTERGLenum
TEXTURE_MIN_LODGLfloat
TEXTURE_SWIZZLE_AGLenum
TEXTURE_SWIZZLE_BGLenum
TEXTURE_SWIZZLE_GGLenum
TEXTURE_SWIZZLE_RGLenum
TEXTURE_WRAP_RGLenum
TEXTURE_WRAP_SGLenum
TEXTURE_WRAP_TGLenum

If pname is not in the table above, generates an INVALID_ENUM error.

If an attempt is made to call this function with no WebGLTexture bound (see above), generates an INVALID_OPERATION error.

If an OpenGL error is generated, returns null.

Programs and Shaders

any getProgramParameter(WebGLProgram? program, GLenum pname) (OpenGL ES 3.0.2 §6.1.12, man page)
Return the value for the passed pname given the passed program. The type returned is the natural type for the requested pname, as given in the following table:
pnamereturned type
DELETE_STATUSGLboolean
LINK_STATUSGLboolean
VALIDATE_STATUSGLboolean
ATTACHED_SHADERSGLint
ACTIVE_ATTRIBUTESGLint
ACTIVE_UNIFORMSGLint
TRANSFORM_FEEDBACK_BUFFER_MODEGLenum
TRANSFORM_FEEDBACK_VARYINGSGLint
ACTIVE_UNIFORM_BLOCKSGLint

If pname is not in the table above, generates an INVALID_ENUM error and returns null.

Returns null if any OpenGL errors are generated during the execution of this function.

Uniforms and attributes

Writing to the drawing buffer

Multiple render targets

Query objects

Sampler objects

Sync objects

Sync objects

Transform feedback

Uniform Buffer objects

Vertex Array objects

Other differences Between WebGL 2.0 and WebGL 1.0

Needs update for WebGL 2.0

Differences Between WebGL and OpenGL ES 3.0

Needs update for WebGL 2.0

This section describes changes made to the WebGL API relative to the OpenGL ES 3.0 API to improve portability across various operating systems and devices.

References

Normative references

[WEBGL10]
WebGL Specification 1.0.2, C. Marrin 2013.
[GLES30]
OpenGL® ES Version 3.0.2, B. Lipchak 2013.
[GLES30GLSL]
The OpenGL® ES Shading Language Version 3.00, R. Simpson, March 2013.
[REGISTRY]
WebGL Extension Registry
[RFC2119]
Key words for use in RFCs to Indicate Requirement Levels, S. Bradner. IETF, March 1997.
[WEBIDL]
Web IDL: W3C Editor’s Draft, C. McCormack.