[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
@@ -8,8 +8,7 @@
#include "Loader.h"
#include <cstdlib>
#include <cstring>
#include <Config.h>
namespace MobileGL::MG_Util::BackendLoader {
namespace {
@@ -61,11 +60,7 @@ namespace MobileGL::MG_Util::BackendLoader {
}
Bool IsShaderSubgroupForcedDisabled() {
const char* value = std::getenv("MOBILEGL_DISABLE_SUBGROUP");
if (!value) {
return false;
}
return std::strcmp(value, "true") == 0 || std::strcmp(value, "TRUE") == 0;
return MG_Config::Features.DisableSubgroup;
}
} // namespace
+2
View File
@@ -63,6 +63,8 @@ namespace MobileGL {
void InitFile() {
#if MOBILEGL_LOG_ENABLE_FILE
if (!s_logFile) {
// MOBILEGL_LOG_FILE_PATH must stay a raw getenv (not MG_Config::Features):
// InitFile() runs before MG_ConfigLoader::Init() in MobileGL::Initialize().
const char* logPath = std::getenv("MOBILEGL_LOG_FILE_PATH");
if (!logPath || !*logPath) {
logPath = MOBILEGL_LOG_FILE_PATH;