Skip to content

Commit

Permalink
fix(webgpu): Chrome has removed requestAdapterInfo() (#2293)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibgreen authored Dec 5, 2024
1 parent 5c313ac commit 7e55b4b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/webgpu/src/adapter/webgpu-device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@ export class WebGPUDevice extends Device {
throw new Error('Failed to request WebGPU adapter');
}

const adapterInfo = await adapter.requestAdapterInfo();
// Note: adapter.requestAdapterInfo() has been replaced with adapter.info. Fall back in case adapter.info is not available
const adapterInfo =
adapter.info ||
// @ts-ignore
(await adapter.requestAdapterInfo?.());
log.probe(2, 'Adapter available', adapterInfo)();

const requiredFeatures: GPUFeatureName[] = [];
Expand Down

0 comments on commit 7e55b4b

Please sign in to comment.