Fix Vulkan renderer string for NVIDIA
The Vulkan physical device properties "deviceName" field does not
include "NVIDIA" for all NVIDIA GPUs. Add NVIDIA to the renderer name
in case the PCI vendor ID matches, so that Vulkan backend test
failures can be suppressed on NVIDIA using IsNVIDIA().
BUG=angleproject:2487
Change-Id: I8e440499664e5ba19773f72104d11d076dae727d
Reviewed-on: https://chromium-review.googlesource.com/1013467
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/renderer/vulkan/RendererVk.cpp b/src/libANGLE/renderer/vulkan/RendererVk.cpp
index 1c732cb..be8747a 100644
--- a/src/libANGLE/renderer/vulkan/RendererVk.cpp
+++ b/src/libANGLE/renderer/vulkan/RendererVk.cpp
@@ -579,22 +579,7 @@
std::string RendererVk::getVendorString() const
{
- switch (mPhysicalDeviceProperties.vendorID)
- {
- case VENDOR_ID_AMD:
- return "Advanced Micro Devices";
- case VENDOR_ID_NVIDIA:
- return "NVIDIA";
- case VENDOR_ID_INTEL:
- return "Intel";
- default:
- {
- // TODO(jmadill): More vendor IDs.
- std::stringstream strstr;
- strstr << "Vendor ID: " << mPhysicalDeviceProperties.vendorID;
- return strstr.str();
- }
- }
+ return GetVendorString(mPhysicalDeviceProperties.vendorID);
}
std::string RendererVk::getRendererDescription() const
@@ -608,7 +593,18 @@
strstr << VK_VERSION_MINOR(apiVersion) << ".";
strstr << VK_VERSION_PATCH(apiVersion);
- strstr << "(" << mPhysicalDeviceProperties.deviceName << ")";
+ strstr << "(";
+
+ // In the case of NVIDIA, deviceName does not necessarily contain "NVIDIA". Add "NVIDIA" so that
+ // Vulkan end2end tests can be selectively disabled on NVIDIA. TODO(jmadill): should not be
+ // needed after http://anglebug.com/1874 is fixed and end2end_tests use more sophisticated
+ // driver detection.
+ if (mPhysicalDeviceProperties.vendorID == VENDOR_ID_NVIDIA)
+ {
+ strstr << GetVendorString(mPhysicalDeviceProperties.vendorID) << " ";
+ }
+
+ strstr << mPhysicalDeviceProperties.deviceName << ")";
return strstr.str();
}