demo · v132

Lost-device telemetry: adapter info that survives the crash

When device.lost fires you usually no longer hold the adapter; pre-132 you had to stash it alongside every device to file a crash report with vendor/architecture info. v132 attaches adapterInfo to the device itself, so the loss handler captures it in one read.

click run to acquire a device…

pre-132 pattern (manual stashing)

let _adapter, _device;
async function init() {
  _adapter = await navigator.gpu.requestAdapter();
  _device = await _adapter.requestDevice();
  _device.lost.then((info) => report({
    reason: info.reason,
    msg: info.message,
    vendor: _adapter.info.vendor,        // need adapter
    architecture: _adapter.info.architecture,
  }));
}

v132+ pattern (one read)

let _device;
async function init() {
  const adapter = await navigator.gpu.requestAdapter();
  _device = await adapter.requestDevice();
  _device.lost.then((info) => report({
    reason: info.reason,
    msg: info.message,
    vendor: _device.adapterInfo.vendor,        // directly on device
    architecture: _device.adapterInfo.architecture,
  }));
}

see also