值
一個 GPUQueue 物件例項。
示例
基本 GPUQueue 訪問
js
async function init() {
if (!navigator.gpu) {
throw Error("WebGPU not supported.");
}
const adapter = await navigator.gpu.requestAdapter();
if (!adapter) {
throw Error("Couldn't request WebGPU adapter.");
}
// Create a GPUDevice
const device = await adapter.requestDevice();
// …
// Common queue use — end current frame by passing array of
// command buffers to queue for execution
device.queue.submit([commandEncoder.finish()]);
// …
}
注意:有關更多佇列示例,請參閱 GPUQueue 參考頁面。
規範
| 規範 |
|---|
| WebGPU # dom-gpudevice-queue |
瀏覽器相容性
載入中…