[Refactor] (MG_Config): centralize env-var and driver-feature reads

MG_Config::FeaturesTable snapshots every MOBILEGL_* toggle once in
ConfigLoader::Init with a single truthy rule (non-empty, not '0', not
'false' case-insensitively), replacing 13 scattered std::getenv sites
that used four different parsing conventions. Renderer-derived bits
(IsAngleRenderer/IsAngleLlvmpipeRenderer/AvoidSamplerMipmapMinFilter)
move into GLESCapabilities, set once in FillInGLESCapabilities, so hot
paths (glMemoryBarrier ANGLE flush, sampler min-filter sync) stop doing
per-call string scans. MOBILEGL_PRESENT_DUMP_CALL/_CURRENT_CALL stay
live getenv (the retrace harness mutates them at runtime) and
MOBILEGL_LOG_FILE_PATH stays in Log.cpp (log init precedes config
init); both are documented in Config.h. Known semantic unification:
MOBILEGL_DISABLE_SUBGROUP previously required exactly 'true' and
MOBILEGL_PRESENT_STATS exactly '1'; both now follow the shared rule
(CI's 0/1 values parse identically). Also bumps CoreVersion to 26.07.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-10 01:08:06 +00:00
co-authored by Claude Fable 5
parent 096d6f591b
commit 7d31a6fcd7
7 changed files with 97 additions and 15 deletions
+5 -4
View File
@@ -41,13 +41,14 @@ namespace MobileGL::MG_Backend::DirectGLES {
constexpr const char* ZERO_BASED_INSTANCE_ID_NAME = "mg_ZeroBasedInstanceID";
static Bool IsAngleLlvmpipeRenderer() {
return g_GLESCapabilities.GLESRendererString.find("ANGLE") != String::npos &&
g_GLESCapabilities.GLESRendererString.find("llvmpipe") != String::npos;
return g_GLESCapabilities.IsAngleLlvmpipeRenderer;
}
static Bool ShouldAvoidSamplerMipmapMinFilterOnAngleLlvmpipe() {
const char* value = std::getenv("MOBILEGL_ANGLE_LLVMPIPE_AVOID_SAMPLER_MIPMAP_MIN_FILTER");
return value != nullptr && std::strcmp(value, "1") == 0 && IsAngleLlvmpipeRenderer();
// IsAngleLlvmpipeRenderer combined with the
// MOBILEGL_ANGLE_LLVMPIPE_AVOID_SAMPLER_MIPMAP_MIN_FILTER feature toggle,
// both resolved in FillInGLESCapabilities.
return g_GLESCapabilities.AvoidSamplerMipmapMinFilter;
}
static GLenum ResolveBackendMinFilter(const SamplerParameters& samplerParams,