From 088071a5a7dfcdbd66c363a0cde1d442f52080fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Beaufort?= Date: Tue, 14 Sep 2021 16:15:35 +0000 Subject: [PATCH] Add device ID and vendor ID to device properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Commit-Queue: François Beaufort --- dawn.json | 2 ++ src/dawn_native/Adapter.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/dawn.json b/dawn.json index 6ee48d8bd8..8e584d1fd5 100644 --- a/dawn.json +++ b/dawn.json @@ -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"}, diff --git a/src/dawn_native/Adapter.cpp b/src/dawn_native/Adapter.cpp index 87f873b8fd..87b5f9a1fb 100644 --- a/src/dawn_native/Adapter.cpp +++ b/src/dawn_native/Adapter.cpp @@ -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.