[js/webgpu] Prefer adapter.info to adapter.requestAdapterInfo (#21065)

WebGPU is deprecating async adapter.requestAdapterInfo, and replacing it
with sync adapter.info.
Spec change: https://github.com/gpuweb/gpuweb/pull/4662
This commit is contained in:
Yang Gu 2024-06-19 03:02:38 +08:00 committed by GitHub
parent dadd0c451a
commit 1473d66a00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 10 deletions

View file

@ -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();

View file

@ -25,7 +25,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",
@ -324,10 +324,11 @@
}
},
"node_modules/@webgpu/types": {
"version": "0.1.38",
"resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.38.tgz",
"integrity": "sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA==",
"dev": true
"version": "0.1.42",
"resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.42.tgz",
"integrity": "sha512-uvJtt4OD1Vjdebrrz3kNLgpOicYbikwnM8WPG6YD2lkCOHDtPdEtCINJFIFtbOCtPfA8SreR/vKyUNbAt92IwQ==",
"dev": true,
"license": "BSD-3-Clause"
},
"node_modules/accepts": {
"version": "1.3.8",
@ -3774,9 +3775,9 @@
}
},
"@webgpu/types": {
"version": "0.1.38",
"resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.38.tgz",
"integrity": "sha512-7LrhVKz2PRh+DD7+S+PVaFd5HxaWQvoMqBbsV9fNJO1pjUs1P8bM2vQVNfk+3URTqbuTI7gkXi0rfsN0IadoBA==",
"version": "0.1.42",
"resolved": "https://registry.npmjs.org/@webgpu/types/-/types-0.1.42.tgz",
"integrity": "sha512-uvJtt4OD1Vjdebrrz3kNLgpOicYbikwnM8WPG6YD2lkCOHDtPdEtCINJFIFtbOCtPfA8SreR/vKyUNbAt92IwQ==",
"dev": true
},
"accepts": {

View file

@ -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",