Skip to content

Commit

Permalink
[js/webgpu] Prefer adapter.info to adapter.requestAdapterInfo
Browse files Browse the repository at this point in the history
WebGPU is deprecating async adapter.requestAdapterInfo, and replacing it
with sync adapter.info.
Spec change: gpuweb/gpuweb#4662
  • Loading branch information
Yang Gu committed Jun 17, 2024
1 parent 0babc33 commit 7d566b4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 23 deletions.
2 changes: 1 addition & 1 deletion js/web/lib/wasm/jsep/backend-webgpu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class WebGpuBackend {
}

this.device = await adapter.requestDevice(deviceDescriptor);
this.adapterInfo = new AdapterInfoImpl(await adapter.requestAdapterInfo());
this.adapterInfo = new AdapterInfoImpl(adapter.info || await adapter.requestAdapterInfo());
this.gpuDataManager = createGpuDataManager(this);
this.programManager = new ProgramManager(this);
this.kernels = new Map();
Expand Down
32 changes: 11 additions & 21 deletions js/web/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"@types/minimatch": "^5.1.2",
"@types/minimist": "^1.2.2",
"@types/platform": "^1.3.4",
"@webgpu/types": "^0.1.38",
"@webgpu/types": "^0.1.42",
"base64-js": "^1.5.1",
"chai": "^4.3.7",
"electron": "^28.1.4",
Expand Down

0 comments on commit 7d566b4

Please sign in to comment.