From 77ac40a7b08b2b5f7a7f37061a7336af561bbf3f Mon Sep 17 00:00:00 2001 From: Austin Eng Date: Tue, 23 Nov 2021 22:25:56 +0000 Subject: [PATCH] Add adapterType to WGPUDeviceProperties This Dawn-internal struct is used to send Adapter information from the GPU to Renderer process. We need adapterType to determine the isFallbackAdapter property of GPUAdapter in Chromium. Bug: chromium:1266550 Change-Id: Ia0457119f45a165e7bdb5b85c43c120391c7001b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/70580 Reviewed-by: Brandon Jones Reviewed-by: Kai Ninomiya Commit-Queue: Kai Ninomiya Auto-Submit: Austin Eng --- dawn.json | 1 + src/dawn_native/Adapter.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/dawn.json b/dawn.json index 4954b29d60..3445fe23b1 100644 --- a/dawn.json +++ b/dawn.json @@ -1108,6 +1108,7 @@ "members": [ {"name": "device ID", "type": "uint32_t"}, {"name": "vendor ID", "type": "uint32_t"}, + {"name": "adapter type", "type": "adapter type"}, {"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 f57e44bc2f..e5b5f2b193 100644 --- a/src/dawn_native/Adapter.cpp +++ b/src/dawn_native/Adapter.cpp @@ -111,6 +111,7 @@ namespace dawn_native { WGPUDeviceProperties adapterProperties = {}; adapterProperties.deviceID = mPCIInfo.deviceId; adapterProperties.vendorID = mPCIInfo.vendorId; + adapterProperties.adapterType = static_cast(mAdapterType); mSupportedFeatures.InitializeDeviceProperties(&adapterProperties); // This is OK for now because there are no limit feature structs.