GPUCommandBuffer

فهرست فصل‌ها دانلود آرشیوناشر

MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونه‌کد

{{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.

توجه: Once a GPUCommandBuffer object has been submitted, it cannot be used again.

{{InheritanceDiagram}}

Instance properties

  • {{domxref("GPUCommandBuffer.label", "label")}}
  • : A string providing a label that can be used to identify the object, for example in {{domxref("GPUError")}} messages or console warnings.

Examples

js
// …

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

توجه: Study the WebGPU samples to find complete examples.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also

  • The WebGPU API