Commit 2383f344 by Jonah Ryan-Davis Committed by Commit Bot

Port disable_timestamp_queries GPU workaround to ANGLE

There is a driver bug in VMWare drivers related to timer queries. This driver is already disabled in Chrome, this CL ports the workaround to ANGLE. Bug: chromium:1075876 Bug: chromium:811661 Change-Id: I87ab28b803191884658d0c1ad4bfdfdd1b727fd0 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2219420Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
parent 4d7a3993
......@@ -436,6 +436,11 @@ struct FeaturesGL : FeatureSetBase
Feature disableSemaphoreFd = {"disable_semaphore_fd", FeatureCategory::OpenGLWorkarounds,
"Disable GL_EXT_semaphore_fd extension", &members,
"https://crbug.com/1046462"};
// GL_EXT_disjoint_timer_query doesn't work properly with Linux VMWare drivers.
Feature disableTimestampQueries = {
"disable_timestamp_queries", FeatureCategory::OpenGLWorkarounds,
"Disable GL_EXT_disjoint_timer_query extension", &members, "https://crbug.com/811661"};
};
inline FeaturesGL::FeaturesGL() = default;
......
......@@ -28,6 +28,7 @@ enum VendorID : uint32_t
// This is Qualcomm PCI Vendor ID.
// Android doesn't have a PCI bus, but all we need is a unique id.
VENDOR_ID_QUALCOMM = 0x5143,
VENDOR_ID_VMWARE = 0x15AD,
};
enum AndroidDeviceID : uint32_t
......@@ -74,6 +75,11 @@ inline bool IsQualcomm(uint32_t vendorId)
return vendorId == VENDOR_ID_QUALCOMM;
}
inline bool IsVMWare(uint32_t vendorId)
{
return vendorId == VENDOR_ID_VMWARE;
}
inline bool IsNexus5X(uint32_t vendorId, uint32_t deviceId)
{
return IsQualcomm(vendorId) && deviceId == ANDROID_DEVICE_ID_NEXUS5X;
......
......@@ -1275,9 +1275,10 @@ void GenerateCaps(const FunctionsGL *functions,
extensions->eglSyncOES = functions->hasGLESExtension("GL_OES_EGL_sync");
if (functions->isAtLeastGL(gl::Version(3, 3)) ||
functions->hasGLExtension("GL_ARB_timer_query") ||
functions->hasGLESExtension("GL_EXT_disjoint_timer_query"))
if (!features.disableTimestampQueries.enabled &&
(functions->isAtLeastGL(gl::Version(3, 3)) ||
functions->hasGLExtension("GL_ARB_timer_query") ||
functions->hasGLESExtension("GL_EXT_disjoint_timer_query")))
{
extensions->disjointTimerQuery = true;
......@@ -1550,6 +1551,7 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature
bool isIntel = IsIntel(vendor);
bool isNvidia = IsNvidia(vendor);
bool isQualcomm = IsQualcomm(vendor);
bool isVMWare = IsVMWare(vendor);
std::array<int, 3> mesaVersion = {0, 0, 0};
bool isMesa = IsMesa(functions, &mesaVersion);
......@@ -1735,6 +1737,8 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature
ANGLE_FEATURE_CONDITION(
features, disableSemaphoreFd,
IsLinux() && isAMD && isMesa && mesaVersion < (std::array<int, 3>{19, 3, 5}));
ANGLE_FEATURE_CONDITION(features, disableTimestampQueries, IsLinux() && isVMWare);
}
void InitializeFrontendFeatures(const FunctionsGL *functions, angle::FrontendFeatures *features)
......
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