From 19a4400ae8ff3d8bbd0eabae08561c33087e688d Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sat, 19 Sep 2026 22:13:14 -0400 Subject: [PATCH] [MG_Pipe] (Disaggregated): P5f fe - retain live capture snapshots across make-current --- MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp | 2 +- MobileGL/MG_Pipe/PipeApply.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp index ee0eb67d..9d113eb0 100644 --- a/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp +++ b/MobileGL/MG_Backend/DirectGLES/DirectGLES.cpp @@ -1993,7 +1993,7 @@ namespace MobileGL::MG_Backend::DirectGLES { xfb.scattered = false; xfb.scatterProgram.reset(); #if MOBILEGL_BUILD_DISAGGREGATED - xfb.scatterArchive.reset(); + xfb.scatterArchive.reset(); #endif xfb.scatterCapacityVertices = 0; if (program->NeedsScatteredTransformFeedbackCapture()) { diff --git a/MobileGL/MG_Pipe/PipeApply.cpp b/MobileGL/MG_Pipe/PipeApply.cpp index fdbb459b..5190a0b0 100644 --- a/MobileGL/MG_Pipe/PipeApply.cpp +++ b/MobileGL/MG_Pipe/PipeApply.cpp @@ -1381,7 +1381,9 @@ namespace MobileGL::MG_Pipe { g_applier.BoundShaderCso = kMGPipeNullHandle; #if MOBILEGL_BUILD_DISAGGREGATED g_applier.BoundStreamOutputLifetimeId = 0; - g_applier.StreamOutputSpans.clear(); + // Begin is emitted once per span, not on make-current. Its immutable object + // snapshot survives with the resource/program records until End or release; + // set_context_values restores the returning context's bound lifetime id. #endif // P5e (sb, CONTRACT-P5E.md ยง5.6): the three binding-point windows are per-context // WORKING state and go with the rest of it - a returning context has its own @@ -1586,6 +1588,9 @@ namespace MobileGL::MG_Pipe { // memory the rule exists to stop it reading. One store, inert until the caps bit is // published, and it is what makes the two roles' third clause the same clause. g_applier.IsTransformFeedbackActive = values.IsTransformFeedbackActive != 0; +#if MOBILEGL_BUILD_DISAGGREGATED + g_applier.BoundStreamOutputLifetimeId = values.BoundTransformFeedbackLifetimeId; +#endif } void MGPipeApplySetPatchState(const MGPPatchState& patch) {