diff --git a/specs/latest/2.0/index.html b/specs/latest/2.0/index.html index 17087d6d8..186cee0a4 100644 --- a/specs/latest/2.0/index.html +++ b/specs/latest/2.0/index.html @@ -266,6 +266,15 @@
typedef long long GLint64;
typedef unsigned long long GLuint64;
+
+dictionary WebGLCopyElementImageConfig {
+ GLfloat sx;
+ GLfloat sy;
+ GLfloat swidth;
+ GLfloat sheight;
+ GLsizei width;
+ GLsizei height;
+};
@@ -935,6 +944,10 @@ offset is the byte offset into the WebGLBuffer's data store; generates an INVALID_VALUE error if it's less than 0.
The ETC2 and EAC texture formats defined in OpenGL ES 3.0 are not available in WebGL 2.0. + +
Like texSubImage2D, this function updates a rectangular subregion of an existing texture image. It does not define or allocate texture storage. The texture image identified by target and level must have been previously defined, for example by calling texImage2D or texStorage2D; otherwise, generates an INVALID_OPERATION error.
The level argument identifies the mipmap level of the texture object bound to target to update. The xoffset and yoffset arguments specify the offsets, in texels, within that mipmap level at which the update begins.
The element argument identifies an element image snapshot, as defined by HTML. The HTML algorithms define how element image snapshots are created, updated, retrieved, and filtered for security- or privacy-sensitive information. If element is an Element, the source rendering is the snapshot from the most recent paint event for the canvas of the current context. If element is an ElementImage, the source rendering is that captured snapshot.
If this function is called with an Element that is not a direct child of the canvas of the current context in the most recent rendering update, generates an INVALID_OPERATION error.
If target is not TEXTURE_2D, generates an INVALID_ENUM error.
If no WebGLTexture is bound to target, generates an INVALID_OPERATION error.
If a WebGLBuffer is bound to the PIXEL_UNPACK_BUFFER target, generates an INVALID_OPERATION error.
All UNPACK_ pixel store parameters are ignored by this function.
If config.sx, config.sy, config.swidth, and config.sheight are all supplied, they define the source rectangle of the element image snapshot to render, in CSS pixels. If none of them are supplied, the source rectangle has sx and sy of 0, swidth equal to the source's natural width, and sheight equal to the source's natural height. If only some of them are supplied, generates an INVALID_VALUE error.
If config.width and config.height are both supplied, they define, in texels, the size of the rasterized image and the destination subregion to update. The source rectangle is scaled to these dimensions. If neither member is supplied, the width and height default to the source rectangle size scaled by the inverse of the canvas-grid-to-CSS scaling factor used to produce the element image snapshot. If only one of them is supplied, generates an INVALID_VALUE error.
The internal format of the texture image identified by target and level must be one of the values in the following table. Each value has an implied source format of RGBA and the listed implied source type:
| Texture Internal Format | Implied Source Type |
|---|---|
| RGBA8 | UNSIGNED_BYTE |
| SRGB8_ALPHA8 | UNSIGNED_BYTE |
| RGBA16F | HALF_FLOAT |
| RGBA32F | FLOAT |
The RGBA source values produced by rendering the element image snapshot are computed independently of the texture's internal format. In particular, when the internal format is RGBA8 or SRGB8_ALPHA8, the generated UNSIGNED_BYTE source values are identical; the choice between those formats only affects the texture's storage and subsequent sampling behavior.
If the texture image's internal format is not listed in the table above, generates an INVALID_OPERATION error.
If level, xoffset, or yoffset is negative, or if the destination subregion extends outside the texture image, generates an INVALID_VALUE error.
If any supplied numeric member of config is negative, or if the computed source rectangle width, source rectangle height, rasterized image width, or rasterized image height is not positive, generates an INVALID_VALUE error.