mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 05:38:31 +09:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user