Commit 63c15519 by Jonah Ryan-Davis Committed by Commit Bot

Also use GL_RENDERER to determine vendorID

~10% or more Linux users* do not have AMD/ATI in the GL_VENDOR, only in GL_RENDERER. Our heuristics only checked GL_VENDOR, so this CL adds GL_RENDERER to the string being checked to find the vendor ID. (*According to https://feedback.wildfiregames.com/report/opengl/feature/GL_VENDOR) Bug: angleproject:4204 Change-Id: Ie89080b4431fdf02a4ca09709973ea3f271a3e84 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1953486Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
parent b92ec244
...@@ -38,11 +38,11 @@ namespace rx ...@@ -38,11 +38,11 @@ namespace rx
VendorID GetVendorID(const FunctionsGL *functions) VendorID GetVendorID(const FunctionsGL *functions)
{ {
std::string nativeVendorString(reinterpret_cast<const char *>(functions->getString(GL_VENDOR))); std::string nativeVendorString(reinterpret_cast<const char *>(functions->getString(GL_VENDOR)));
if (nativeVendorString.find("Intel") != std::string::npos) // Concatenate GL_RENDERER to the string being checked because some vendors put their names in
{ // GL_RENDERER
return VENDOR_ID_INTEL; nativeVendorString +=
} " " + std::string(reinterpret_cast<const char *>(functions->getString(GL_RENDERER)));
else if (nativeVendorString.find("NVIDIA") != std::string::npos) if (nativeVendorString.find("NVIDIA") != std::string::npos)
{ {
return VENDOR_ID_NVIDIA; return VENDOR_ID_NVIDIA;
} }
...@@ -55,6 +55,10 @@ VendorID GetVendorID(const FunctionsGL *functions) ...@@ -55,6 +55,10 @@ VendorID GetVendorID(const FunctionsGL *functions)
{ {
return VENDOR_ID_QUALCOMM; return VENDOR_ID_QUALCOMM;
} }
else if (nativeVendorString.find("Intel") != std::string::npos)
{
return VENDOR_ID_INTEL;
}
else else
{ {
return VENDOR_ID_UNKNOWN; return VENDOR_ID_UNKNOWN;
......
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