GPUCommandBuffer
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.
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
Examples
// ...
const commandBuffer = commandEncoder.finish();
device.queue.submit([commandBuffer]);
Note: Study the WebGPU samples to find complete examples.
Specifications
| Specification |
|---|
| WebGPU # gpucommandbuffer |
Browser compatibility
BCD tables only load in the browser
See also
- The WebGPU API