Commit c6a0618f by Olli Etuaho Committed by Commit Bot

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: 's avatarJamie Madill <jmadill@chromium.org>
parent 505ea1bb
......@@ -117,4 +117,23 @@ bool IsKabylake(uint32_t DeviceId)
return std::find(std::begin(Kabylake), std::end(Kabylake), DeviceId) != std::end(Kabylake);
}
const char *GetVendorString(uint32_t vendorId)
{
switch (vendorId)
{
case VENDOR_ID_AMD:
return "Advanced Micro Devices";
case VENDOR_ID_NVIDIA:
return "NVIDIA";
case VENDOR_ID_INTEL:
return "Intel";
case VENDOR_ID_QUALCOMM:
return "Qualcomm";
default:
// TODO(jmadill): More vendor IDs.
ASSERT(vendorId == 0xba5eba11); // Mock vendor ID used for tests.
return "Unknown";
}
}
} // namespace rx
\ No newline at end of file
......@@ -45,6 +45,8 @@ inline bool IsQualcomm(uint32_t vendor_id)
return vendor_id == VENDOR_ID_QUALCOMM;
}
const char *GetVendorString(uint32_t vendorId);
// Intel
class IntelDriverVersion
{
......
......@@ -579,22 +579,7 @@ vk::ErrorOrResult<uint32_t> RendererVk::selectPresentQueueForSurface(VkSurfaceKH
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 @@ std::string RendererVk::getRendererDescription() const
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();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment