Commit 90e3d86c by Peng Huang Committed by Commit Bot

Disable timestamp queries for Mali-G31 and older GPUs

Bug: chromium:1178333 Change-Id: I8f21cd1c8f815a5cd7344778d2d1b28710dc6763 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2779211Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Commit-Queue: Peng Huang <penghuang@chromium.org>
parent 2a43f43a
......@@ -98,6 +98,20 @@ int getMaliTNumber(const FunctionsGL *functions)
return number;
}
int getMaliGNumber(const FunctionsGL *functions)
{
static int number = -1;
if (number == -1)
{
const char *nativeGLRenderer = GetString(functions, GL_RENDERER);
if (std::sscanf(nativeGLRenderer, "Mali-G%d", &number) < 1)
{
number = 0;
}
}
return number;
}
bool IsAdreno42xOr3xx(const FunctionsGL *functions)
{
int number = getAdrenoNumber(functions);
......@@ -116,6 +130,12 @@ bool IsMaliT8xxOrOlder(const FunctionsGL *functions)
return number != 0 && number < 900;
}
bool IsMaliG31OrOlder(const FunctionsGL *functions)
{
int number = getMaliGNumber(functions);
return number != 0 && number <= 31;
}
int GetAndroidSdkLevel()
{
if (!IsAndroid())
......@@ -1979,7 +1999,8 @@ void InitializeFeatures(const FunctionsGL *functions, angle::FeaturesGL *feature
features, disableTimestampQueries,
(IsLinux() && isVMWare) || (IsAndroid() && isNvidia) ||
(IsAndroid() && GetAndroidSdkLevel() < 27 && IsAdreno5xxOrOlder(functions)) ||
(IsAndroid() && IsMaliT8xxOrOlder(functions)));
(IsAndroid() && IsMaliT8xxOrOlder(functions)) ||
(IsAndroid() && IsMaliG31OrOlder(functions)));
ANGLE_FEATURE_CONDITION(features, encodeAndDecodeSRGBForGenerateMipmap, IsApple());
......
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