From a568b7e38fc2a3e76e2428501de1591b3a7667c2 Mon Sep 17 00:00:00 2001 From: Geoff Lang Date: Tue, 30 Jun 2020 17:03:56 -0400 Subject: [PATCH] Add a frontend feature to disable anisotropic filtering. This allows us to disable support for GL_EXT_texture_filter_anisotropic at runtime and make performance comparisons. Bug: b/167404532 Change-Id: Id80458e7f116e195366432fe73e8e776e9a3047b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2278024 Commit-Queue: Geoff Lang Reviewed-by: Courtney Goeltzenleuchter Reviewed-by: Tim Van Patten --- include/platform/FrontendFeatures.h | 6 ++++++ src/libANGLE/Context.cpp | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/include/platform/FrontendFeatures.h b/include/platform/FrontendFeatures.h index f48ea7581..e99a164ab 100644 --- a/include/platform/FrontendFeatures.h +++ b/include/platform/FrontendFeatures.h @@ -54,6 +54,12 @@ struct FrontendFeatures : angle::FeatureSetBase angle::Feature disableProgramBinary = { "disable_program_binary", angle::FeatureCategory::FrontendFeatures, "Disable support for GL_OES_get_program_binary", &members, "http://anglebug.com/5007"}; + + // Allow disabling of GL_EXT_texture_filter_anisotropic through a runtime feature for + // performance comparisons. + angle::Feature disableAnisotropicFiltering = { + "disable_anisotropic_filtering", angle::FeatureCategory::FrontendWorkarounds, + "Disable support for anisotropic filtering", &members}; }; inline FrontendFeatures::FrontendFeatures() = default; diff --git a/src/libANGLE/Context.cpp b/src/libANGLE/Context.cpp index fde04d1c6..09737198a 100644 --- a/src/libANGLE/Context.cpp +++ b/src/libANGLE/Context.cpp @@ -3209,6 +3209,11 @@ Extensions Context::generateSupportedExtensions() const supportedExtensions.colorBufferFloatRGBA = false; } + if (getFrontendFeatures().disableAnisotropicFiltering.enabled) + { + supportedExtensions.textureFilterAnisotropic = false; + } + // Some extensions are always available because they are implemented in the GL layer. supportedExtensions.bindUniformLocation = true; supportedExtensions.vertexArrayObjectOES = true;