Firefox Tomorrow

web api instance property

GPUDevice: adapterInfo property

View on MDN ↗

Secure contextAvailable in workers

The adapterInfo read-only property of the GPUDevice interface returns a GPUAdapterInfo object containing identifying information about the device’s originating adapter.

Value

A GPUAdapterInfo object instance.

Examples

Basic adapterInfo usage

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

const myDevice = await adapter.requestDevice();

function optimizeForGpuDevice(device) {
  if (device.adapterInfo.vendor === "amd") {
    // Use AMD-specific optimizations
  } else if (device.adapterInfo.architecture.includes("turing")) {
    // Optimize for NVIDIA Turing architecture
  }
}

optimizeForGpuDevice(myDevice);

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also