GPUCommandBuffer
WebGPU API
WebGPU API
The **`GPUCommandBuffer`** interface of the WebGPU API represents a pre-recorded list of GPU commands that can be submitted to a GPUQueue for execution.
A `GPUCommandBuffer` is created via the GPUCommandEncoder.finish() method; the GPU commands recorded within are submitted for execution by passing the `GPUCommandBuffer` into the parameter of a GPUQueue.submit() call.
> [!NOTE]
> Once a `GPUCommandBuffer` object has been submitted, it cannot be used again.
## Instance properties
- label
- : A string providing a label that can be used to identify the object, for example in GPUError messages or console warnings.
## Examples
```js
// …
const commandBuffer = commandEncoder.finish();
device.queue.submit([commandBuffer]);
```
> [!NOTE]
> Study the [WebGPU samples](https://webgpu.github.io/webgpu-samples/) to find complete examples.
## Specifications
## Browser compatibility
## See also
- The [WebGPU API](/docs/Web/API/WebGPU_API)
Cite this
"GPUCommandBuffer". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/GPUCommandBuffer JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy