值
一个 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 |
浏览器兼容性
加载中…