files/en-us/web/api/gpucommandbuffer/index.md
{{APIRef("WebGPU API")}}{{SecureContext_Header}}{{AvailableInWorkers}}
The GPUCommandBuffer interface of the {{domxref("WebGPU API", "WebGPU API", "", "nocode")}} represents a pre-recorded list of GPU commands that can be submitted to a {{domxref("GPUQueue")}} for execution.
A GPUCommandBuffer is created via the {{domxref("GPUCommandEncoder.finish()")}} method; the GPU commands recorded within are submitted for execution by passing the GPUCommandBuffer into the parameter of a {{domxref("GPUQueue.submit()")}} call.
[!NOTE] Once a
GPUCommandBufferobject has been submitted, it cannot be used again.
{{InheritanceDiagram}}
// …
const commandBuffer = commandEncoder.finish();
device.queue.submit([commandBuffer]);
[!NOTE] Study the WebGPU samples to find complete examples.
{{Specifications}}
{{Compat}}