Get to know MDN better
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Note: This feature is available in Web Workers.
The GPUQuerySet interface of the WebGPU API is used to record the results of queries on passes, such as occlusion or timestamp queries.
Occlusion queries are available on render passes to query whether any fragment samples pass all the per-fragment tests for a set of drawing commands (including scissor, sample mask, alpha to coverage, stencil, and depth tests). To run an occlusion query, an appropriate GPUQuerySet must be provided as the value of the occlusionQuerySet descriptor property when invoking GPUCommandEncoder.beginRenderPass() to run a render pass.
Timestamp queries allow applications to write timestamps to a GPUQuerySet. To run a timestamp query, appropriate GPUQuerySets must be provided inside the value of the timestampWrites descriptor property when invoking GPUCommandEncoder.beginRenderPass() to run a render pass, or GPUCommandEncoder.beginComputePass() to run a compute pass.
Note: The timestamp-query feature needs to be enabled to use timestamp queries.
A GPUQuerySet object instance is created using the GPUDevice.createQuerySet() method.
A number specifying the number of queries managed by the GPUQuerySet.
labelA string providing a label that can be used to identify the object, for example in GPUError messages or console warnings.
type Read onlyAn enumerated value specifying the type of queries managed by the GPUQuerySet.
Destroys the GPUQuerySet.
The following snippet creates a GPUQuerySet that holds 32 occlusion query results, and then returns the type and count:
| WebGPU # gpuqueryset |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jun 18, 2025 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.