[Fix] (MG_Backend/DirectGLES): survive ES context recreation in buffer ops

Track context generation + synced change serial per resource; re-register
ops on MakeCurrent. Fixes frozen buffer contents after the trace replayer's
probe context teardown.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-07-08 15:02:38 +08:00
co-authored by Claude Fable 5
parent b8ffd25148
commit f355080b6f
3 changed files with 63 additions and 7 deletions
@@ -3485,6 +3485,9 @@ namespace MobileGL::MG_Backend::DirectGLES {
return false;
}
t_backendContextCurrent = true;
// The ops table may have been unregistered when a previous ES context was
// destroyed (e.g. a probe context); re-register now that GL is usable.
BufferImpl::RegisterBufferBackendOps();
return true;
}
@@ -3511,7 +3514,7 @@ namespace MobileGL::MG_Backend::DirectGLES {
}
void DestroyEGLContext() {
BufferImpl::UnregisterBufferBackendOps();
BufferImpl::OnBackendContextDestroyed();
t_backendContextCurrent = false;
if (g_Display != EGL_NO_DISPLAY) {
g_EGLFuncs.eglMakeCurrent(g_Display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);