[Refactor] (MG_Impl/GLImpl): replace Flywheel dispatch sync hack with MOBILEGL_COHERENT_AS_FLUSH

This commit is contained in:
2026-07-15 21:51:20 -04:00
parent f80f6f4a62
commit 3e4ce5caa7
28 changed files with 295 additions and 62 deletions
@@ -149,6 +149,11 @@ bool LoadMobileGL(const Request& request, std::string& error) {
} else {
unsetenv("MOBILEGL_AVOID_SAMPLER_MIPMAP_MIN_FILTER");
}
if (request.coherentAsFlush) {
setenv("MOBILEGL_COHERENT_AS_FLUSH", "1", 1);
} else {
unsetenv("MOBILEGL_COHERENT_AS_FLUSH");
}
void* handle = dlopen(request.mobileGlLibrary.c_str(), RTLD_NOW | RTLD_GLOBAL);
if (handle == nullptr) {
@@ -36,6 +36,7 @@ struct Request {
bool useAngle = false;
bool usePbuffer = true;
bool avoidAngleLlvmpipeSamplerMipmapMinFilter = false;
bool coherentAsFlush = false;
int holdMs = 0;
};
@@ -101,7 +101,8 @@ Java_top_mobilegl_plugin_trace_TraceReplayActivity_nativeRunTraceReplay(JNIEnv*
jstring angleVariant,
jboolean useAngle,
jboolean usePbuffer,
jboolean avoidAngleLlvmpipeSamplerMipmapMinFilter) {
jboolean avoidAngleLlvmpipeSamplerMipmapMinFilter,
jboolean coherentAsFlush) {
mobilegl_trace::Request request;
request.tracePath = ToString(env, tracePath);
request.goldenPath = ToString(env, goldenPath);
@@ -126,6 +127,7 @@ Java_top_mobilegl_plugin_trace_TraceReplayActivity_nativeRunTraceReplay(JNIEnv*
request.usePbuffer = usePbuffer == JNI_TRUE;
request.avoidAngleLlvmpipeSamplerMipmapMinFilter =
avoidAngleLlvmpipeSamplerMipmapMinFilter == JNI_TRUE;
request.coherentAsFlush = coherentAsFlush == JNI_TRUE;
ScopedTraceReplayState replayState;
mobilegl_trace_set_requested_size(request.width, request.height);