From 228bd24c677eac5963f328816790cbe58a3a505e Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Fri, 2 Oct 2026 21:00:20 -0400 Subject: [PATCH] [Fix] (Espryt): turn window buffer age on by default --- MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp index a6e1922d..e1ca00a3 100644 --- a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp +++ b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp @@ -17193,23 +17193,22 @@ namespace MobileGL::MG_Backend::DirectGLES { // session's apply) thread; the present ends the frame. thread_local EGLSurface t_ageAskedSurface = EGL_NO_SURFACE; - // A WINDOW SURFACE'S BUFFER AGE IS OPT-IN (MOBILEGL_ESPRYT_WINDOW_AGE=1, or on Android the - // property debug.mobilegl.espryt_window_age=1); off, a window answers 0 and its client - // repaints whole frames. Measured on Adreno 750 with the compositor repainting by age: with a - // client presenting far faster than the display (hundreds of frames a second), about one run - // in six ended with part of a window showing a frame two or three presents old, with the - // driver's partial-update age and with EGL_BUFFER_PRESERVED alike, and never at sixty frames - // a second or with whole repaints. Whole repaints hide whatever goes stale; until that is - // found, they stay the default here. Pbuffers (client windows) are not affected. + // A WINDOW SURFACE'S BUFFER AGE, on unless MOBILEGL_ESPRYT_WINDOW_AGE=0 (or, on Android, the + // property debug.mobilegl.espryt_window_age=0); off, a window answers 0 and its client + // repaints whole frames. It was opt-in while a window repainted by age sometimes showed a + // client frame two or three presents old: the client's shared image had kept its previous + // frame, its copy clipped by a scissor guard that trusted another session's render-state + // shadow (ScopedScissorDisable) - whole repaints only happened to leave that shadow + // agreeing with the client. Pbuffers (client windows) are not affected. Bool WindowBufferAgeEnabled() { static const Bool enabled = [] { - if (const char* env = std::getenv("MOBILEGL_ESPRYT_WINDOW_AGE")) return std::strcmp(env, "1") == 0; + if (const char* env = std::getenv("MOBILEGL_ESPRYT_WINDOW_AGE")) return std::strcmp(env, "0") != 0; #if defined(__ANDROID__) char property[PROP_VALUE_MAX] = {}; if (__system_property_get("debug.mobilegl.espryt_window_age", property) > 0) - return std::strcmp(property, "1") == 0; + return std::strcmp(property, "0") != 0; #endif - return false; + return true; }(); return enabled; }