docs.rodeo

MDN Web Docs mirror

WebGLQuery

{{APIRef("WebGL")}} {{AvailableInWorkers}} 

The WebGLQuery interface is part of the WebGL 2 API and provides ways to asynchronously query for information. By default, occlusion queries and primitive queries are available.

Another kind of queries are disjoint timer queries, which allow you to measure performance and profiling of your GPU. Disjoint timer queries are available with the {{domxref("EXT_disjoint_timer_query")}}  extension only.

{{InheritanceDiagram}} 

When working with WebGLQuery objects, the following methods of the {{domxref("WebGL2RenderingContext")}}  are useful:

Examples

Creating a WebGLQuery object

in this example, gl must be a {{domxref("WebGL2RenderingContext")}} . WebGLQuery objects are not available in WebGL 1.

const query = gl.createQuery();

Specifications

{{Specifications}} 

Browser compatibility

{{Compat}} 

See also

In this article

View on MDN