GPUQueue: label 屬性
注意:此功能在 Web Workers 中可用。
GPUQueue 介面的 label 只讀屬性是一個字串,提供了一個可用於標識物件的標籤,例如在 GPUError 訊息或控制檯警告中。
你可以直接在 GPUQueue 物件上獲取和設定它。
值
一個字串。如果之前沒有設定標籤值,則獲取標籤會返回一個空字串。
示例
透過 GPUQueue.label 設定和獲取標籤
js
device.queue.label = "my_queue";
console.log(device.queue.label); // "my_queue"
你也可以在請求裝置時設定佇列的標籤,如下所示:
js
const device = adapter.requestDevice({
defaultQueue: { label: "my_queue" },
});
規範
| 規範 |
|---|
| WebGPU # dom-gpuobjectbase-label |
瀏覽器相容性
載入中…