Add GPU detection for WARP
Adds WARP to known vendor/device Ids so
tests can detect when MBR is being used.
BUG=dawn:463
TEST=dawn_end2end_tests
Change-Id: I19f16dfeb4839c5a7c0a993bab94d2b6ca4ca36d
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/24680
Reviewed-by: Rafael Cintron <rafael.cintron@microsoft.com>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Bryan Bernhart <bryan.bernhart@intel.com>
diff --git a/src/common/GPUInfo.cpp b/src/common/GPUInfo.cpp
index 60076d2..c3ea9ce 100644
--- a/src/common/GPUInfo.cpp
+++ b/src/common/GPUInfo.cpp
@@ -36,4 +36,7 @@
bool IsSwiftshader(PCIVendorID vendorId, PCIDeviceID deviceId) {
return vendorId == kVendorID_Google && deviceId == kDeviceID_Swiftshader;
}
+ bool IsWARP(PCIVendorID vendorId, PCIDeviceID deviceId) {
+ return vendorId == kVendorID_Microsoft && deviceId == kDeviceID_WARP;
+ }
} // namespace gpu_info
diff --git a/src/common/GPUInfo.h b/src/common/GPUInfo.h
index d16c89b..87efbbc 100644
--- a/src/common/GPUInfo.h
+++ b/src/common/GPUInfo.h
@@ -29,8 +29,10 @@
static constexpr PCIVendorID kVendorID_Nvidia = 0x10DE;
static constexpr PCIVendorID kVendorID_Qualcomm = 0x5143;
static constexpr PCIVendorID kVendorID_Google = 0x1AE0;
+ static constexpr PCIVendorID kVendorID_Microsoft = 0x1414;
static constexpr PCIDeviceID kDeviceID_Swiftshader = 0xC0DE;
+ static constexpr PCIDeviceID kDeviceID_WARP = 0x8c;
bool IsAMD(PCIVendorID vendorId);
bool IsARM(PCIVendorID vendorId);
@@ -39,6 +41,7 @@
bool IsNvidia(PCIVendorID vendorId);
bool IsQualcomm(PCIVendorID vendorId);
bool IsSwiftshader(PCIVendorID vendorId, PCIDeviceID deviceId);
+ bool IsWARP(PCIVendorID vendorId, PCIDeviceID deviceId);
} // namespace gpu_info
#endif // COMMON_GPUINFO_H
diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp
index b71e84f..64e7455 100644
--- a/src/tests/DawnTest.cpp
+++ b/src/tests/DawnTest.cpp
@@ -647,6 +647,10 @@
mParam.adapterProperties.deviceID);
}
+bool DawnTestBase::IsWARP() const {
+ return gpu_info::IsWARP(mParam.adapterProperties.vendorID, mParam.adapterProperties.deviceID);
+}
+
bool DawnTestBase::IsWindows() const {
#ifdef DAWN_PLATFORM_WINDOWS
return true;
diff --git a/src/tests/DawnTest.h b/src/tests/DawnTest.h
index dddb9ad..7a29bc0 100644
--- a/src/tests/DawnTest.h
+++ b/src/tests/DawnTest.h
@@ -239,6 +239,7 @@
bool IsNvidia() const;
bool IsQualcomm() const;
bool IsSwiftshader() const;
+ bool IsWARP() const;
bool IsWindows() const;
bool IsLinux() const;
diff --git a/src/tests/white_box/D3D12SmallTextureTests.cpp b/src/tests/white_box/D3D12SmallTextureTests.cpp
index e3ab8cd..5566e15 100644
--- a/src/tests/white_box/D3D12SmallTextureTests.cpp
+++ b/src/tests/white_box/D3D12SmallTextureTests.cpp
@@ -43,7 +43,7 @@
DAWN_SKIP_TEST_IF(!IsBCFormatSupported());
// TODO(http://crbug.com/dawn/282): Investigate GPU/driver rejections of small alignment.
- DAWN_SKIP_TEST_IF(IsIntel() || IsNvidia());
+ DAWN_SKIP_TEST_IF(IsIntel() || IsNvidia() || IsWARP());
wgpu::TextureDescriptor descriptor;
descriptor.dimension = wgpu::TextureDimension::e2D;