Add device ID and vendor ID to device properties

This CL adds device ID and vendor ID to device properties so that WebGPU
can access it to help populate GPUAdapter.name.

Bug: chromium:1231163
Change-Id: I460e5a72ffba350f88d2649789a61eaea9670135
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/64180
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: François Beaufort <beaufort.francois@gmail.com>
This commit is contained in:
François Beaufort 2021-09-14 16:15:35 +00:00 committed by Dawn LUCI CQ
parent 77755b9f55
commit 088071a5a7
2 changed files with 4 additions and 0 deletions

View File

@ -873,6 +873,8 @@
"category": "structure",
"extensible": false,
"members": [
{"name": "device ID", "type": "uint32_t"},
{"name": "vendor ID", "type": "uint32_t"},
{"name": "texture compression BC", "type": "bool", "default": "false"},
{"name": "texture compression ETC2", "type": "bool", "default": "false"},
{"name": "texture compression ASTC", "type": "bool", "default": "false"},

View File

@ -65,6 +65,8 @@ namespace dawn_native {
WGPUDeviceProperties AdapterBase::GetAdapterProperties() const {
WGPUDeviceProperties adapterProperties = {};
adapterProperties.deviceID = mPCIInfo.deviceId;
adapterProperties.vendorID = mPCIInfo.vendorId;
mSupportedExtensions.InitializeDeviceProperties(&adapterProperties);
// This is OK for now because there are no limit extension structs.