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 createRenderBundleEncoder() method of the GPUDevice interface creates a GPURenderBundleEncoder that can be used to pre-record bundles of commands. These can be reused in GPURenderPassEncoders via the executeBundles() method, as many times as required.
An object containing the following properties:
colorFormatsAn array of enumerated values specifying the expected color formats for render targets. For possible values, see the GPUTextureFormat definition in the spec.
depthReadOnly OptionalA boolean. If true, specifies that executing any GPURenderBundle created by the GPURenderBundleEncoder will not modify the depth component of the depthStencilFormat when executed. If omitted, depthReadOnly will default to false.
depthStencilFormat OptionalAn enumerated value that specifies the expected depth-or-stencil format for render targets. For possible values, see the Depth-stencil formats section of the spec.
label OptionalA string providing a label that can be used to identify the object, for example in GPUError messages or console warnings.
sampleCount OptionalA number representing the expected sample count for render targets.
stencilReadOnly OptionalA boolean. If true, specifies that executing any GPURenderBundle created by the GPURenderBundleEncoder will not modify the stencil component of the depthStencilFormat when executed. If omitted, stencilReadOnly will default to false.
A GPURenderBundleEncoder object instance.
In the WebGPU Samples Animometer example, numerous similar operations are done on many different objects simultaneously. A bundle of commands is encoded using the following function:
Later on, a GPURenderBundleEncoder is created using createRenderBundleEncoder(), the function is invoked, and the command bundle is recorded into a GPURenderBundle using GPURenderBundleEncoder.finish():
GPURenderPassEncoder.executeBundles() is then used to reuse the work across multiple render passes to improve performance. Study the example code listing for the full context.
| WebGPU # dom-gpudevice-createrenderbundleencoder |
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.