GPUCommandBuffer
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Note: This feature is available in Web Workers.
Giao diện GPUCommandBuffer của WebGPU API đại diện cho một danh sách các lệnh GPU được ghi trước có thể được gửi đến GPUQueue để thực thi.
GPUCommandBuffer được tạo thông qua phương thức GPUCommandEncoder.finish(); các lệnh GPU được ghi trong đó được gửi để thực thi bằng cách truyền GPUCommandBuffer vào tham số của lệnh gọi GPUQueue.submit().
Note:
Một khi đối tượng GPUCommandBuffer đã được gửi, nó không thể được sử dụng lại.
Thuộc tính phiên bản
Ví dụ
js
// …
const commandBuffer = commandEncoder.finish();
device.queue.submit([commandBuffer]);
Note: Nghiên cứu WebGPU samples để tìm ví dụ đầy đủ.
Thông số kỹ thuật
| Specification |
|---|
| WebGPU> # gpucommandbuffer> |