From b1f55026af70d42fc3e9f806dd50454d9257458c Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Mon, 13 Jul 2026 20:45:40 -0400 Subject: [PATCH] [Chore] (MobileGL/ConfigLoader): rename/clean up more env var clutter --- MobileGL/Config.h | 8 ++++---- MobileGL/ConfigLoader.cpp | 6 +++--- MobileGL/MG_Backend/DirectGLES/Managers.cpp | 2 +- .../DirectVulkan/BackendObject_DirectVulkan.cpp | 2 +- .../MG_Backend/DirectVulkan/Renderer/VkTextureManager.cpp | 2 +- MobileGL/MG_Util/BackendLoaders/OpenGL/Loader.cpp | 2 +- MobileGL/MG_Util/BackendLoaders/OpenGL/Loader.h | 2 +- android-plugin/app/src/trace/cpp/trace_replay_core.cpp | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/MobileGL/Config.h b/MobileGL/Config.h index 1c253a98..0de4c3ca 100644 --- a/MobileGL/Config.h +++ b/MobileGL/Config.h @@ -42,12 +42,12 @@ namespace MobileGL::MG_Config { // MOBILEGL_DISABLE_SUBGROUP: force-disable Vulkan shader subgroup support. Bool DisableSubgroup = false; // MOBILEGL_MAGMA_R11G11B10F_FALLBACK: use fallback format for R11G11B10F on Vulkan. - Bool VulkanR11G11B10FFallback = false; + Bool MagmaR11G11B10FFallback = false; // MOBILEGL_MAGMA_FRAMESINFLIGHT: requested Magma frames in flight, defaulting to 3. Uint32 MagmaFramesInFlight = 3; - // MOBILEGL_ANGLE_LLVMPIPE_AVOID_SAMPLER_MIPMAP_MIN_FILTER: avoid mipmap min - // filters in samplers on ANGLE/llvmpipe renderers. - Bool AvoidAngleLlvmpipeSamplerMipmapMinFilter = false; + // MOBILEGL_AVOID_SAMPLER_MIPMAP_MIN_FILTER: avoid mipmap min filters in samplers, + // resolves certain rendering bugs on ANGLE + llvmpipe. + Bool AvoidSamplerMipmapMinFilter = false; // MOBILEGL_PRESENT_DUMP_PATH: directory for present frame dumps (DirectVulkan). String PresentDumpPath; // MOBILEGL_PRESENT_STATS: log present pixel statistics (DirectVulkan backend). diff --git a/MobileGL/ConfigLoader.cpp b/MobileGL/ConfigLoader.cpp index 0b8a0fe1..3b58eb39 100644 --- a/MobileGL/ConfigLoader.cpp +++ b/MobileGL/ConfigLoader.cpp @@ -113,10 +113,10 @@ namespace MobileGL::MG_ConfigLoader { features.RetraceUseAngle = QueryEnvFlag("MOBILEGL_RETRACE_USE_ANGLE"); QueryEnvVariable("MOBILEGL_RETRACE_ANGLE_DIR", features.RetraceAngleDir, ""); features.DisableSubgroup = QueryEnvFlag("MOBILEGL_DISABLE_SUBGROUP"); - features.VulkanR11G11B10FFallback = QueryEnvFlag("MOBILEGL_MAGMA_R11G11B10F_FALLBACK"); + features.MagmaR11G11B10FFallback = QueryEnvFlag("MOBILEGL_MAGMA_R11G11B10F_FALLBACK"); features.MagmaFramesInFlight = QueryEnvUint32("MOBILEGL_MAGMA_FRAMESINFLIGHT", 3, 1, 64); - features.AvoidAngleLlvmpipeSamplerMipmapMinFilter = - QueryEnvFlag("MOBILEGL_ANGLE_LLVMPIPE_AVOID_SAMPLER_MIPMAP_MIN_FILTER"); + features.AvoidSamplerMipmapMinFilter = + QueryEnvFlag("MOBILEGL_AVOID_SAMPLER_MIPMAP_MIN_FILTER"); QueryEnvVariable("MOBILEGL_PRESENT_DUMP_PATH", features.PresentDumpPath, ""); features.PresentStats = QueryEnvFlag("MOBILEGL_PRESENT_STATS"); features.TraceSkipAutodestroy = QueryEnvFlag("MOBILEGL_TRACE_SKIP_AUTODESTROY"); diff --git a/MobileGL/MG_Backend/DirectGLES/Managers.cpp b/MobileGL/MG_Backend/DirectGLES/Managers.cpp index c517b186..a0823d1f 100644 --- a/MobileGL/MG_Backend/DirectGLES/Managers.cpp +++ b/MobileGL/MG_Backend/DirectGLES/Managers.cpp @@ -46,7 +46,7 @@ namespace MobileGL::MG_Backend::DirectGLES { static Bool ShouldAvoidSamplerMipmapMinFilterOnAngleLlvmpipe() { // IsAngleLlvmpipeRenderer combined with the - // MOBILEGL_ANGLE_LLVMPIPE_AVOID_SAMPLER_MIPMAP_MIN_FILTER feature toggle, + // MOBILEGL_AVOID_SAMPLER_MIPMAP_MIN_FILTER feature toggle, // both resolved in FillInGLESCapabilities. return g_GLESCapabilities.AvoidSamplerMipmapMinFilter; } diff --git a/MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp b/MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp index 114c89e5..c359cb59 100644 --- a/MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/BackendObject_DirectVulkan.cpp @@ -24,7 +24,7 @@ namespace MobileGL::MG_Backend::DirectVulkan { namespace { Bool IsR11G11B10FFallbackEnabled() { - return MG_Config::Features.VulkanR11G11B10FFallback; + return MG_Config::Features.MagmaR11G11B10FFallback; } Bool IsReleaseCurrentRequest(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) { diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/VkTextureManager.cpp b/MobileGL/MG_Backend/DirectVulkan/Renderer/VkTextureManager.cpp index f4c9403b..50e6562e 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/VkTextureManager.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/VkTextureManager.cpp @@ -53,7 +53,7 @@ namespace MobileGL::MG_Backend::DirectVulkan { }; static Bool IsR11G11B10FFallbackEnabled() { - return MG_Config::Features.VulkanR11G11B10FFallback; + return MG_Config::Features.MagmaR11G11B10FFallback; } static Bool IsMultisampleTextureUploadTarget(TextureUploadTarget target) { diff --git a/MobileGL/MG_Util/BackendLoaders/OpenGL/Loader.cpp b/MobileGL/MG_Util/BackendLoaders/OpenGL/Loader.cpp index ef9e2a06..d1009636 100644 --- a/MobileGL/MG_Util/BackendLoaders/OpenGL/Loader.cpp +++ b/MobileGL/MG_Util/BackendLoaders/OpenGL/Loader.cpp @@ -946,7 +946,7 @@ namespace MobileGL::MG_Util::BackendLoader { caps.IsAngleLlvmpipeRenderer = caps.IsAngleRenderer && caps.GLESRendererString.find("llvmpipe") != String::npos; caps.AvoidSamplerMipmapMinFilter = - caps.IsAngleLlvmpipeRenderer && MG_Config::Features.AvoidAngleLlvmpipeSamplerMipmapMinFilter; + caps.IsAngleLlvmpipeRenderer && MG_Config::Features.AvoidSamplerMipmapMinFilter; MGLOG_I(" GL_EXT_disjoint_timer_query supported: %s", caps.SupportsDisjointTimerQuery ? "true" : "false"); MGLOG_I(" ANGLE renderer: %s", caps.IsAngleRenderer ? "true" : "false"); diff --git a/MobileGL/MG_Util/BackendLoaders/OpenGL/Loader.h b/MobileGL/MG_Util/BackendLoaders/OpenGL/Loader.h index ff556d8e..ef0283b7 100644 --- a/MobileGL/MG_Util/BackendLoaders/OpenGL/Loader.h +++ b/MobileGL/MG_Util/BackendLoaders/OpenGL/Loader.h @@ -1049,7 +1049,7 @@ namespace MobileGL { // GL_RENDERER contains both "ANGLE" and "llvmpipe". Bool IsAngleLlvmpipeRenderer = false; // IsAngleLlvmpipeRenderer combined with the - // MOBILEGL_ANGLE_LLVMPIPE_AVOID_SAMPLER_MIPMAP_MIN_FILTER feature toggle: + // MOBILEGL_AVOID_SAMPLER_MIPMAP_MIN_FILTER feature toggle: // sampler min filters should drop their mipmap component. Bool AvoidSamplerMipmapMinFilter = false; // True when indirect draws leak the command's baseInstance word ("reserved, diff --git a/android-plugin/app/src/trace/cpp/trace_replay_core.cpp b/android-plugin/app/src/trace/cpp/trace_replay_core.cpp index cfd649ca..f974f673 100644 --- a/android-plugin/app/src/trace/cpp/trace_replay_core.cpp +++ b/android-plugin/app/src/trace/cpp/trace_replay_core.cpp @@ -150,9 +150,9 @@ bool LoadMobileGL(const Request& request, std::string& error) { unsetenv("MOBILEGL_RETRACE_ANGLE_DIR"); } if (request.avoidAngleLlvmpipeSamplerMipmapMinFilter) { - setenv("MOBILEGL_ANGLE_LLVMPIPE_AVOID_SAMPLER_MIPMAP_MIN_FILTER", "1", 1); + setenv("MOBILEGL_AVOID_SAMPLER_MIPMAP_MIN_FILTER", "1", 1); } else { - unsetenv("MOBILEGL_ANGLE_LLVMPIPE_AVOID_SAMPLER_MIPMAP_MIN_FILTER"); + unsetenv("MOBILEGL_AVOID_SAMPLER_MIPMAP_MIN_FILTER"); } void* handle = dlopen(request.mobileGlLibrary.c_str(), RTLD_NOW | RTLD_GLOBAL);