recursal/MDN huggingface dataset:
WebGL2RenderingContext: waitSync() method
=========================================

 The **`WebGL2RenderingContext.waitSync()`** method of the WebGL 2 API returns immediately, but waits on
 the GL server until the given `WebGLSync` object is signaled.

 The method is a no-op in the absence of the possibility of synchronizing between
 multiple GL contexts.

Syntax
------


```js
waitSync(sync, flags, timeout)
```

### Parameters

`sync`

A `WebGLSync` object on which to wait on.

`flags`

 A `GLbitfield` specifying a bitwise combination of flags controlling
 the flushing behavior. Must be `0` (exists for extensions only).


`timeout`

 A `GLint64` specifying a timeout the server should wait before
 continuing. Must be `gl.TIMEOUT_IGNORED`.


### Return value

None (`undefined`).

Examples
--------


```js
const sync = gl.fenceSync(gl.SYNC\_GPU\_COMMANDS\_COMPLETE, 0);
gl.waitSync(sync, 0, gl.TIMEOUT\_IGNORED);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.14 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLSync`
WebGL2RenderingContext: clientWaitSync() method
===============================================

 The **`WebGL2RenderingContext.clientWaitSync()`** method of the
 WebGL 2 API blocks and waits for a
 `WebGLSync` object to become signaled or a given timeout to be passed.

Syntax
------


```js
clientWaitSync(sync, flags, timeout)
```

### Parameters

`sync`

A `WebGLSync` object on which to wait on.

`flags`

 A `GLbitfield` specifying a bitwise combination of flags controlling
 the flushing behavior. May be `gl.SYNC_FLUSH_COMMANDS_BIT`.


`timeout`

 A `GLint64` specifying a timeout (in nanoseconds) for which to wait for
 the sync object to become signaled. Must not be larger than
 `gl.MAX_CLIENT_WAIT_TIMEOUT_WEBGL`.


### Return value

A `GLenum` indicating the sync object's status.

* `gl.ALREADY_SIGNALED`: Indicates that the sync object was signaled when
 this method was called.
* `gl.TIMEOUT_EXPIRED`: Indicates that the `timeout` time passed
 and that the sync object did not become signaled.
* `gl.CONDITION_SATISFIED`: Indicates that the sync object was signaled
 before the `timeout` expired.
* `gl.WAIT_FAILED`: Indicates that an error occurred during the execution.
Examples
--------


```js
const sync = gl.fenceSync(gl.SYNC\_GPU\_COMMANDS\_COMPLETE, 0);
const status = gl.clientWaitSync(sync, 0, 0);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.14 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLSync`
WebGL2RenderingContext: compressedTexSubImage3D() method
========================================================

 The **`WebGL2RenderingContext.compressedTexSubImage3D()`**
 method of the WebGL API specifies a
 three-dimensional sub-rectangle for a texture image in a compressed format.

Syntax
------


```js
compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, offset)

compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, srcData)
compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, srcData, srcOffset)
compressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, srcData, srcOffset, srcLengthOverride)
```

### Parameters

`target`

 A `GLenum` specifying the binding point (target) of the active texture.
 Possible values:


* `gl.TEXTURE_3D`: A three-dimensional texture.
* `gl.TEXTURE_2D_ARRAY`: A two-dimensional array texture.

`level`

 A `GLint` specifying the level of detail. Level 0 is the base image
 level and level *n* is the n-th mipmap reduction level.


`xoffset`

A `GLint` specifying the x offset within the compressed texture image.

`yoffset`

A `GLint` specifying the y offset within the compressed texture image.

`zoffset`

A `GLint` specifying the z offset within the compressed texture image.

`width`

A `GLsizei` specifying the width of the texture.

`height`

A `GLsizei` specifying the height of the texture.

`depth`

A `GLsizei` specifying the depth of the texture.

`format`

A `GLenum` specifying the compressed image format. Possible values:

* `gl.COMPRESSED_R11_EAC`
* `gl.COMPRESSED_SIGNED_R11_EAC`
* `gl.COMPRESSED_RG11_EAC`
* `gl.COMPRESSED_SIGNED_RG11_EAC`
* `gl.COMPRESSED_RGB8_ETC2`
* `gl.COMPRESSED_RGBA8_ETC2_EAC`
* `gl.COMPRESSED_SRGB8_ETC2`
* `gl.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC`
* `gl.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2`
* `gl.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2`

`imageSize`

 A `GLint` specifying the number of bytes to read from the buffer bound
 to `gl.PIXEL_UNPACK_BUFFER`.


`offset`

 A `GLint` specifying the offset in bytes from which to read from the
 buffer bound to `gl.PIXEL_UNPACK_BUFFER`.


`srcData`

 A `TypedArray` or a `DataView` object that will be used as a data store for the compressed
 image data in memory.


### Return value

None (`undefined`).

Examples
--------


```js
gl.compressedTexSubImage3D(
  gl.TEXTURE\_3D,
  0,
  0,
  0,
  512,
  512,
  512,
  gl.COMPRESSED\_R11\_EAC,
  textureData,
);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.6 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLRenderingContext.compressedTexSubImage2D()`
* `WebGL2RenderingContext.compressedTexImage3D()`
WebGL2RenderingContext: getActiveUniforms() method
==================================================

 The **`WebGL2RenderingContext.getActiveUniforms()`** method of
 the WebGL 2 API retrieves information about
 active uniforms within a `WebGLProgram`.

Syntax
------


```js
getActiveUniforms(program, uniformIndices, pname)
```

### Parameters

`program`

A `WebGLProgram` containing the active uniforms.

`uniformIndices`

 An `Array` of `GLuint` specifying the indices of the active
 uniforms to query.


`pname`

A `GLenum` specifying which information to query. Possible values:

`gl.UNIFORM_TYPE`

 Returns an `Array` of
 `GLenum` indicating the types of the uniforms.


`gl.UNIFORM_SIZE`

 Returns an `Array` of
 `GLuint` indicating the sizes of the uniforms.


`gl.UNIFORM_BLOCK_INDEX`

 Returns an `Array` of
 `GLint` indicating the block indices of the uniforms.


`gl.UNIFORM_OFFSET`

 Returns an `Array` of
 `GLint` indicating the uniform buffer offsets.


`gl.UNIFORM_ARRAY_STRIDE`

 Returns an `Array` of
 `GLint` indicating the strides between the elements.


`gl.UNIFORM_MATRIX_STRIDE`

 Returns an `Array` of
 `GLint` indicating the strides between columns of a column-major
 matrix or a row-major matrix.


`gl.UNIFORM_IS_ROW_MAJOR`

 Returns an `Array` of
 `GLboolean` indicating whether each of the uniforms is a row-major
 matrix or not.



### Return value

Depends on which information is requested using the `pname` parameter.

Examples
--------


```js
const uniformIndices = gl.getUniformIndices(program, [
  "UBORed",
  "UBOGreen",
  "UBOBlue",
]);
const uniformOffsets = gl.getActiveUniforms(
  program,
  uniformIndices,
  gl.UNIFORM\_OFFSET,
);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.16 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGL2RenderingContext.getActiveUniformBlockParameter()`
WebGL2RenderingContext: drawArraysInstanced() method
====================================================

 The **`WebGL2RenderingContext.drawArraysInstanced()`** method
 of the WebGL 2 API renders primitives from
 array data like the `gl.drawArrays()`
 method. In addition, it can execute multiple instances of the range of elements.


**Note:** When using WebGL 1,
 the `ANGLE_instanced_arrays` extension can provide this method,
 too.


Syntax
------


```js
drawArraysInstanced(mode, first, count, instanceCount)
```

### Parameters

`mode`

 A `GLenum` specifying the type primitive to render. Possible values
 are:


* `gl.POINTS`: Draws a single dot.
* `gl.LINE_STRIP`: Draws a straight line to the next vertex.
* `gl.LINE_LOOP`: Draws a straight line to the next vertex, and
 connects the last vertex back to the first.
* `gl.LINES`: Draws a line between a pair of vertices.
* `gl.TRIANGLE_STRIP`
* `gl.TRIANGLE_FAN`
* `gl.TRIANGLES`: Draws a triangle for a group of three vertices.

`first`

A `GLint` specifying the starting index in the array of vector points.

`count`

A `GLsizei` specifying the number of indices to be rendered.

`instanceCount`

 A `GLsizei` specifying the number of instances of the range of elements
 to execute.


### Return value

None (`undefined`).

Examples
--------


```js
gl.drawArraysInstanced(gl.POINTS, 0, 8, 4);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.9 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `ANGLE_instanced_arrays.drawArraysInstancedANGLE()`
* `WEBGL_multi_draw.multiDrawArraysInstancedWEBGL()`
WebGL2RenderingContext: bindTransformFeedback() method
======================================================

 The **`WebGL2RenderingContext.bindTransformFeedback()`** method
 of the WebGL 2 API binds a
 passed `WebGLTransformFeedback` object to the current GL state.

Syntax
------


```js
bindTransformFeedback(target, transformFeedback)
```

### Parameters

`target`

 A `GLenum` specifying the target (binding point). Must be
 `gl.TRANSFORM_FEEDBACK`.


`transformFeedback`

A `WebGLTransformFeedback` object to bind.

### Return value

None (`undefined`).

Examples
--------


```js
const transformFeedback = gl.createTransformFeedback();
gl.bindTransformFeedback(gl.TRANSFORM\_FEEDBACK, transformFeedback);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.15 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLTransformFeedback`
WebGL2RenderingContext: createTransformFeedback() method
========================================================

 The **`WebGL2RenderingContext.createTransformFeedback()`**
 method of the WebGL 2 API creates and
 initializes `WebGLTransformFeedback` objects.

Syntax
------


```js
createTransformFeedback()
```

### Parameters

None.

### Return value

A `WebGLTransformFeedback` object.

Examples
--------

`gl` must be a `WebGL2RenderingContext`.
 `WebGLTransformFeedback` objects are not available in WebGL 1.


```js
const transformFeedback = gl.createTransformFeedback();
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.15 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLTransformFeedback`
WebGL2RenderingContext: deleteTransformFeedback() method
========================================================

 The **`WebGL2RenderingContext.deleteTransformFeedback()`**
 method of the WebGL 2 API deletes a given
 `WebGLTransformFeedback` object.

Syntax
------


```js
deleteTransformFeedback(transformFeedback)
```

### Parameters

`transformFeedback`

A `WebGLTransformFeedback` object to delete.

### Return value

None (`undefined`).

Examples
--------

`gl` must be a `WebGL2RenderingContext`.
 `WebGLTransformFeedback` objects are not available in WebGL 1.


```js
const transformFeedback = gl.createTransformFeedback();

// …

gl.deleteTransformFeedback(transformFeedback);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.15 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLTransformFeedback`
WebGL2RenderingContext: endTransformFeedback() method
=====================================================

 The **`WebGL2RenderingContext.endTransformFeedback()`** method
 of the WebGL 2 API ends a transform feedback
 operation.

Syntax
------


```js
endTransformFeedback()
```

### Parameters

None.

### Return value

None (`undefined`).

Examples
--------


```js
const transformFeedback = gl.createTransformFeedback();
gl.bindTransformFeedback(gl.TRANSFORM\_FEEDBACK, transformFeedback);
gl.beginTransformFeedback(gl.TRIANGLES);
gl.drawArrays(gl.TRIANGLES, 0, 3);
gl.endTransformFeedback();
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.15 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLTransformFeedback`
WebGL2RenderingContext: getSyncParameter() method
=================================================

 The **`WebGL2RenderingContext.getSyncParameter()`** method of
 the WebGL 2 API returns parameter
 information of a `WebGLSync` object.

Syntax
------


```js
getSyncParameter(sync, pname)
```

### Parameters

`sync`

A `WebGLSync` object.

`pname`

A `GLenum` specifying which information to return. Possible values:

`gl.OBJECT_TYPE`

 Returns a `GLenum` indicating the type
 of the sync object (always `gl.SYNC_FENCE`).


`gl.SYNC_STATUS`

 Returns a `GLenum` indicating the
 status of the sync object (`gl.SIGNALED` or
 `gl.UNSIGNALED`).


`gl.SYNC_CONDITION`

 Returns a `GLenum` indicating the
 sync objects' condition (always `gl.SYNC_GPU_COMMANDS_COMPLETE`).


`gl.SYNC_FLAGS`

 Returns a `GLenum` indicating the flags
 with which the sync object was created (always 0 as no flags are supported).



### Return value

 Depends on the `pname` parameter, either a `GLenum` or a
 `GLbitfield`.

Examples
--------


```js
const sync = gl.fenceSync(gl.SYNC\_GPU\_COMMANDS\_COMPLETE, 0);
gl.getSyncParameter(sync, gl.SYNC\_STATUS);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.14 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLSync`
WebGL2RenderingContext: isSampler() method
==========================================

 The **`WebGL2RenderingContext.isSampler()`** method of the WebGL 2 API returns `true` if the
 passed object is a valid `WebGLSampler` object.

Syntax
------


```js
isSampler(sampler)
```

### Parameters

`sampler`

A `WebGLSampler` object to test.

### Return value

 A `GLboolean` indicating whether the given object is a valid
 `WebGLSampler` object (`true`) or not (`false`).

Examples
--------

`gl` must be a `WebGL2RenderingContext`.
 `WebGLSampler` objects are not available in WebGL 1.


```js
const sampler = gl.createSampler();

// …

gl.isSampler(sampler);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.13 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLSampler`
WebGL2RenderingContext: getTransformFeedbackVarying() method
============================================================

 The **`WebGL2RenderingContext.getTransformFeedbackVarying()`**
 method of the WebGL 2 API returns
 information about varying variables from `WebGLTransformFeedback` buffers.

Syntax
------


```js
getTransformFeedbackVarying(program, index)
```

### Parameters

`program`

A `WebGLProgram`.

`index`

 A `GLuint` specifying the index of the varying variable whose
 information to retrieve`.`

### Return value

A `WebGLActiveInfo` object.

Examples
--------


```js
activeInfo = gl.getTransformFeedbackVarying(program, 0);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.15 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLTransformFeedback`
WebGL2RenderingContext: vertexAttribIPointer() method
=====================================================

 The **`WebGL2RenderingContext.vertexAttribIPointer()`** method
 of the WebGL 2 API specifies integer data
 formats and locations of vertex attributes in a vertex attributes array.

Syntax
------


```js
vertexAttribIPointer(index, size, type, stride, offset)
```

### Parameters

`index`

 A `GLuint` specifying the index of the vertex attribute that is to be
 modified.


`size`

 A `GLint` specifying the number of components per vertex attribute.
 Must be 1, 2, 3, or 4.


`type`

 A `GLenum` specifying the data type of each component in the array.
 Must be one of: `gl.BYTE`, `gl.UNSIGNED_BYTE`,
 `gl.SHORT`, `gl.UNSIGNED_SHORT`, `gl.INT`, or
 `gl.UNSIGNED_INT`.


`stride`

 A `GLsizei` specifying the offset in bytes between the beginning of
 consecutive vertex attributes.


`offset`

 A `GLintptr` specifying an offset in bytes of the first component in
 the vertex attribute array. Must be a multiple of `type`.


### Return value

None (`undefined`).

Description
-----------

 Very similar to `WebGLRenderingContext.vertexAttribPointer()`. The main
 difference is that while values specified by `vertexAttribPointer` are
 always interpreted as floating-point values in the shader (even if they were originally
 specified as integers in the buffer), this method allows specifying values which are
 interpreted as integers in the shader.

Examples
--------

### Linear Blend Skinning


```js
//Describe the layout of the buffer:
//1. position
gl.vertexAttribPointer(0, 3, gl.FLOAT, false, 20, 0);
gl.enableVertexAttribArray(0);
//2. bone weights, normalized to [0, 1]
gl.vertexAttribPointer(1, 4, gl.UNSIGNED\_BYTE, true, 20, 12);
gl.enableVertexAttribArray(1);
//3. bone indices, interpreted as integer
gl.vertexAttribIPointer(2, 4, gl.UNSIGNED\_BYTE, 20, 16);
gl.enableVertexAttribArray(2);

//Connect to attributes from the vertex shader
gl.bindAttribLocation(shaderProgram, 0, "position");
gl.bindAttribLocation(shaderProgram, 1, "boneWeights");
gl.bindAttribLocation(shaderProgram, 2, "boneIndices");
```



```html
<script id="shader-vs" type="x-shader/x-vertex">
 #version 300 es

 uniform mat4 mvMatrix;
 uniform mat4 bones[120];

 in vec3 position;
 in vec4 boneWeights;
 in uvec4 boneIndices;//read as 4-component unsigned integer

 void main() {
 vec4 skinnedPosition =
 bones[boneIndices.s] \* vec4(position, 1.0) \* boneWeights.s +
 bones[boneIndices.t] \* vec4(position, 1.0) \* boneWeights.t +
 bones[boneIndices.p] \* vec4(position, 1.0) \* boneWeights.p +
 bones[boneIndices.q] \* vec4(position, 1.0) \* boneWeights.q;
 gl\_Position = mvMatrix \* skinnedPosition;
 }
</script>
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.8 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLRenderingContext.vertexAttribPointer()`
WebGL2RenderingContext: isTransformFeedback() method
====================================================

 The **`WebGL2RenderingContext.isTransformFeedback()`** method
 of the WebGL 2 API returns `true`
 if the passed object is a valid `WebGLTransformFeedback` object.

Syntax
------


```js
isTransformFeedback(transformFeedback)
```

### Parameters

`transformFeedback`

A `WebGLTransformFeedback` object to test.

### Return value

 A `GLboolean` indicating whether the given object is a valid
 `WebGLTransformFeedback` object (`true`) or not
 (`false`).

Examples
--------

`gl` must be a `WebGL2RenderingContext`.
 `WebGLTransformFeedback` objects are not available in WebGL 1.


```js
const transformFeedback = gl.createTransformFeedback();

// …

gl.isTransformFeedback(transformFeedback);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.15 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLTransformFeedback`
WebGL2RenderingContext: copyBufferSubData() method
==================================================

 The **`WebGL2RenderingContext.copyBufferSubData()`** method of
 the WebGL 2 API copies part of the data of a
 buffer to another buffer.

Syntax
------


```js
copyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size)
```

### Parameters

`readTarget writeTarget`

 A `GLenum` specifying the binding point (target) from whose data store
 should be read or written. Possible values:


* `gl.ARRAY_BUFFER`: Buffer containing vertex attributes, such as
 vertex coordinates, texture coordinate data, or vertex color data.
* `gl.ELEMENT_ARRAY_BUFFER`: Buffer used for element indices.
* `gl.COPY_READ_BUFFER`: Buffer for copying from one buffer object to
 another (provided specifically for copy operations).
* `gl.COPY_WRITE_BUFFER`: Buffer for copying from one buffer object to
 another (provided specifically for copy operations).
* `gl.TRANSFORM_FEEDBACK_BUFFER`: Buffer for transform feedback
 operations.
* `gl.UNIFORM_BUFFER`: Buffer used for storing uniform blocks.
* `gl.PIXEL_PACK_BUFFER`: Buffer used for pixel transfer operations.
* `gl.PIXEL_UNPACK_BUFFER`: Buffer used for pixel transfer operations.

`readOffset writeOffset`

 A `GLintptr` specifying the byte offset from which to start reading
 from or writing to the buffer.


`size`

 A `GLsizei` in bytes specifying the size of the data to be copied from
 `readTarget` to `writeTarget`.


### Return value

None (`undefined`).

Examples
--------


```js
const srcBuffer = gl.createBuffer();
const dstBuffer = gl.createBuffer();

const data = new Float32Array(vertices);
const length = vertices.length \* 4;

gl.bindBuffer(gl.ARRAY\_BUFFER, srcBuffer);
gl.bufferData(gl.ARRAY\_BUFFER, data, gl.STATIC\_DRAW);
gl.bindBuffer(gl.COPY\_READ\_BUFFER, srcBuffer);

gl.bindBuffer(gl.ARRAY\_BUFFER, dstBuffer);
gl.bufferData(gl.ARRAY\_BUFFER, new Float32Array(length), gl.STATIC\_DRAW);

gl.copyBufferSubData(gl.COPY\_READ\_BUFFER, gl.ARRAY\_BUFFER, 0, 0, length);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.3 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLRenderingContext.bufferData()`
* `WebGLRenderingContext.bufferSubData()`
* `WebGLRenderingContext.getBufferParameter()`
* `WebGL2RenderingContext.getBufferSubData()`
WebGL2RenderingContext: isSync() method
=======================================

 The **`WebGL2RenderingContext.isSync()`** method of the WebGL 2 API returns `true` if the
 passed object is a valid `WebGLSync` object.

Syntax
------


```js
isSync(sync)
```

### Parameters

`sync`

A `WebGLSync` object to test.

### Return value

 A `GLboolean` indicating whether the given object is a valid
 `WebGLSync` object (`true`) or not (`false`).

Examples
--------

`gl` must be a `WebGL2RenderingContext`. `WebGLSync`
 objects are not available in WebGL 1.


```js
const sync = gl.fenceSync(gl.SYNC\_GPU\_COMMANDS\_COMPLETE, 0);

// …

gl.isSync(sync);
```

Specifications
--------------

| Specification |
| --- |
| WebGL 2.0 Specification # 3.7.14 |

Browser compatibility
---------------------

BCD tables only load in the browser with JavaScript enabled. Enable JavaScript to view data.

See also
--------

* `WebGLSync`