mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-08 04:08:32 +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:
+1
-2
@@ -13,7 +13,6 @@
|
||||
#include <MG_State/EGLState/Core.h>
|
||||
#include <MG_Impl/GLImpl/Texture/ProxyTexture.h>
|
||||
#include <MG_Impl/GLImpl/Framebuffer/GL_Framebuffer.h>
|
||||
#include <cstdlib>
|
||||
|
||||
namespace MobileGL {
|
||||
namespace {
|
||||
@@ -75,7 +74,7 @@ namespace MobileGL {
|
||||
}
|
||||
|
||||
__attribute__((destructor)) static void AutoDestroy() {
|
||||
if (std::getenv("MOBILEGL_TRACE_SKIP_AUTODESTROY") != nullptr) {
|
||||
if (MG_Config::Features.TraceSkipAutodestroy) {
|
||||
return;
|
||||
}
|
||||
#if defined(__APPLE__)
|
||||
|
||||
Reference in New Issue
Block a user