web api interface
GPUCommandBuffer
Secure contextAvailable in workers
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 finish() method; the GPU commands recorded within are submitted for execution by passing the GPUCommandBuffer into the parameter of a submit() call.
[!NOTE] Once a
GPUCommandBufferobject 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
GPUErrormessages or console warnings.
- : A string providing a label that can be used to identify the object, for example in
Examples
// …
const commandBuffer = commandEncoder.finish();
device.queue.submit([commandBuffer]);
[!NOTE] Study the WebGPU samples to find complete examples.
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.
See also
- The WebGPU API