GPUCommandEncoder: finish() method

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

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 finish() method of the GPUCommandEncoder interface completes recording of the command sequence encoded on this GPUCommandEncoder, returning a corresponding GPUCommandBuffer.

Syntax

js
finish()
finish(descriptor)

Parameters

descriptor Optional

An object that can contain the following properties:

label Optional

A string providing a label for the returned GPUCommandBuffer that can be used to identify it, for example in GPUError messages or console warnings.

Return value

A GPUCommandBuffer object instance.

Validation

The following criteria must be met when calling finish(), otherwise a GPUValidationError is generated and the GPUCommandEncoder becomes invalid:

Examples

js
// ...

const commandBuffer = commandEncoder.finish();
device.queue.submit([commandBuffer]);

// ...

Specifications

Specification
WebGPU
# dom-gpucommandencoder-finish

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
finish
Experimental

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
In development. Supported in a pre-release version.
In development. Supported in a pre-release version.
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.
User must explicitly enable this feature.
Has more compatibility info.

See also