GPURenderBundleEncoder: finish() method - Web APIs | MDN
Syntax
Parameters
descriptorOptional-
An object containing the following properties:
labelOptional-
A string providing a label that can be used to identify the object, for example in
GPUErrormessages or console warnings.
Return value
A GPURenderBundle object instance.
Validation
The following criteria must be met when calling finish(), otherwise a GPUValidationError is generated and the GPURenderBundleEncoder becomes invalid:
- The
GPURenderBundleEncoderis open (i.e., not already ended via afinish()call). - The debug stack for the current render pass is empty (i.e., no render pass debug group is currently open, as opened by
pushDebugGroup()).
Examples
js
const renderBundleEncoder = device.createRenderBundleEncoder({
colorFormats: [presentationFormat],
});
recordRenderPass(renderBundleEncoder);
const renderBundle = renderBundleEncoder.finish();
The above snippet is taken from the WebGPU Samples Animometer example.
Specifications
| Specification |
|---|
| WebGPU # dom-gpurenderbundleencoder-finish |
Browser compatibility
See also
- The WebGPU API