files/en-us/web/api/gpurenderbundleencoder/finish/index.md
{{APIRef("WebGPU API")}}{{SecureContext_Header}}{{AvailableInWorkers}}
The finish() method of the
{{domxref("GPURenderBundleEncoder")}} interface completes recording of the current render bundle command sequence, returning a {{domxref("GPURenderBundle")}} object that can be passed into a {{domxref("GPURenderPassEncoder.executeBundles()")}} call to execute those commands in a specific render pass.
finish(descriptor)
descriptor {{optional_inline}}
label {{optional_inline}}
A {{domxref("GPURenderBundle")}} object instance.
The following criteria must be met when calling finish(), otherwise a {{domxref("GPUValidationError")}} is generated and the {{domxref("GPURenderBundleEncoder")}} becomes invalid:
finish() call).const renderBundleEncoder = device.createRenderBundleEncoder({
colorFormats: [presentationFormat],
});
recordRenderPass(renderBundleEncoder);
const renderBundle = renderBundleEncoder.finish();
The above snippet is taken from the WebGPU Samples Animometer example.
{{Specifications}}
{{Compat}}