From 1956d6cd6fc06e995ee8bc487c45036580a89d96 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 6 Oct 2026 11:56:18 -0400 Subject: [PATCH] [Refactor] (P13 W5 S3): transport-only hooks get no-op twins where the record arm calls them, and their guards return to the transport. --- MobileGL/MG_Backend/DirectGLES/BackendObject_DirectGLES.cpp | 2 +- .../MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp | 2 +- MobileGL/MG_Backend/MGPipe/PipeInputs.h | 2 ++ MobileGL/MG_Impl/Pipe/PipeFill.cpp | 6 +++++- MobileGL/MG_Impl/Pipe/SamplerEmit.h | 2 +- MobileGL/MG_Pipe/PipeApply.cpp | 2 +- MobileGL/MG_Pipe/PipeSessionFail.h | 3 +++ 7 files changed, 14 insertions(+), 5 deletions(-) diff --git a/MobileGL/MG_Backend/DirectGLES/BackendObject_DirectGLES.cpp b/MobileGL/MG_Backend/DirectGLES/BackendObject_DirectGLES.cpp index bc0785d0..5f3f1912 100644 --- a/MobileGL/MG_Backend/DirectGLES/BackendObject_DirectGLES.cpp +++ b/MobileGL/MG_Backend/DirectGLES/BackendObject_DirectGLES.cpp @@ -962,7 +962,7 @@ namespace MobileGL::MG_Backend::DirectGLES { } Bool BackendObject_DirectGLES::LatchIfGpuFaulted() { -#if MOBILEGL_BUILD_RECORD_ARM +#if MOBILEGL_BUILD_DISAGGREGATED return LatchIfGuiltyBeforeApply(); #else return false; diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp b/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp index 74fa315d..98f3e572 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp @@ -1687,7 +1687,7 @@ void main() { return true; } -#if MOBILEGL_BUILD_DISAGGREGATED +#if MOBILEGL_BUILD_RECORD_ARM // P5c (T5 / tx): the split arm of EnsureGenerateMipmapStorageAllocated. Under an active // transport the apply thread may not WRITE the client's level storage - AllocateStorage // and MarkStorageDirty on a frontend TextureObjectMipmap are §6 layer-1 surfaces diff --git a/MobileGL/MG_Backend/MGPipe/PipeInputs.h b/MobileGL/MG_Backend/MGPipe/PipeInputs.h index bca9292c..4c56057d 100644 --- a/MobileGL/MG_Backend/MGPipe/PipeInputs.h +++ b/MobileGL/MG_Backend/MGPipe/PipeInputs.h @@ -1006,6 +1006,8 @@ namespace MobileGL::MG_Pipe { // inline that no caller in such a build ever has a reason to call twice - the disaggregated // arm above is the real one. inline PipeInputs& MGPipeClientInputs() { return gPipeInputs; } + // P13 W5: one block, no client-role stamp to withdraw. + inline void MGPipeClientClearVerbBoundary() {} #endif // Every field has storage or is forwarded, and nothing else. diff --git a/MobileGL/MG_Impl/Pipe/PipeFill.cpp b/MobileGL/MG_Impl/Pipe/PipeFill.cpp index ce83df2a..a095b0c9 100644 --- a/MobileGL/MG_Impl/Pipe/PipeFill.cpp +++ b/MobileGL/MG_Impl/Pipe/PipeFill.cpp @@ -352,6 +352,10 @@ namespace MobileGL::MG_Pipe { namespace { GLContext* LiveContext() { return MG_State::pGLContext.get(); } +#if !MOBILEGL_BUILD_DISAGGREGATED + // P13 W5: no transport, no run-ahead client. + Bool ClientRunsAhead() { return false; } +#endif #if MOBILEGL_BUILD_DISAGGREGATED // ---- P5e (ra): the fill decision (CONTRACT-P5E §3.1) ----------------------------- // @@ -3618,7 +3622,7 @@ namespace MobileGL::MG_Pipe { } #endif MGPipeCsoCacheInstance().Reset(); -#if MOBILEGL_BUILD_RECORD_ARM +#if MOBILEGL_BUILD_DISAGGREGATED if (!resetCrossed) #endif MGPipeApplierReset(); diff --git a/MobileGL/MG_Impl/Pipe/SamplerEmit.h b/MobileGL/MG_Impl/Pipe/SamplerEmit.h index 04ba2ef2..9837850b 100644 --- a/MobileGL/MG_Impl/Pipe/SamplerEmit.h +++ b/MobileGL/MG_Impl/Pipe/SamplerEmit.h @@ -220,7 +220,7 @@ namespace MobileGL::MG_Pipe { // tokens are minted once and never reused (EGLState::CreateContext), which is what makes them // usable as an identity; 0 is "no EGL context", the server's "no context" applier. inline Uint64 MGPipeCurrentShareGroupToken() { -#if MOBILEGL_BUILD_RECORD_ARM +#if MOBILEGL_BUILD_DISAGGREGATED Uint64 bound = 0; if (MG_Impl::EGLImpl::StreamBoundShareGroupToken(&bound)) return bound; #endif diff --git a/MobileGL/MG_Pipe/PipeApply.cpp b/MobileGL/MG_Pipe/PipeApply.cpp index cb27621e..9a98ea6c 100644 --- a/MobileGL/MG_Pipe/PipeApply.cpp +++ b/MobileGL/MG_Pipe/PipeApply.cpp @@ -1495,7 +1495,7 @@ namespace MobileGL::MG_Pipe { return true; } -#if MOBILEGL_BUILD_DISAGGREGATED +#if MOBILEGL_BUILD_RECORD_ARM // Texture records can have a server consumer without the buffer ops table (Magma). // Their staged bytes still belong to the server before SEG_STAGE retires. Keep the // existing backend hooks authoritative when present, and use this fallback otherwise. diff --git a/MobileGL/MG_Pipe/PipeSessionFail.h b/MobileGL/MG_Pipe/PipeSessionFail.h index e9f7cd79..899a1d6f 100644 --- a/MobileGL/MG_Pipe/PipeSessionFail.h +++ b/MobileGL/MG_Pipe/PipeSessionFail.h @@ -173,6 +173,9 @@ namespace MobileGL::MG_Pipe { // presents, included. Asked only for a session with a context bound; asks the environment / // property at most every 100 ms per thread. bool MGPipeDebugSessionLossDue(unsigned clientPid); +#else + // P13 W5: the device-loss knobs end a SESSION; a library without a transport has none to end. + inline bool MGPipeDebugDeviceLossDue() { return false; } #endif } // namespace MobileGL::MG_Pipe