GPUAdapterInfo: thuộc tính device

Khả dụng hạn chế

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.

Thuộc tính chỉ đọc device của giao diện GPUAdapterInfo trả về mã định danh dành riêng cho nhà cung cấp của adapter, hoặc chuỗi rỗng nếu không có sẵn.

Giá trị

Một chuỗi.

Ví dụ

js
const adapter = await navigator.gpu.requestAdapter();
if (!adapter) {
  throw Error("Couldn't request WebGPU adapter.");
}

const adapterInfo = adapter.info;
console.log(adapterInfo.device);

Thông số kỹ thuật

Thông số kỹ thuật
WebGPU
# dom-gpuadapterinfo-device

Tương thích trình duyệt

Xem thêm