diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp b/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp index 554ca607..b73cbab8 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp @@ -406,8 +406,9 @@ namespace MobileGL::MG_Backend::DirectVulkan { }; DynamicTailKey dynamicTailKey{}; }; - // Per Magma session (MagmaSession.h): it shadows the session's own command buffer. - static SessionLocal g_dynamicStateShadow; + // Per Magma session (MagmaSession.h): it shadows the session's own command buffer. Inline, + // so every file of the renderer shares the one instance. + inline SessionLocal g_dynamicStateShadow; // ---- D12.3: DynamicTailKey's inputs against the P2 chunk table ---- // diff --git a/MobileGL/MG_Backend/DirectVulkan/Renderer/WireFramebuffer.inc b/MobileGL/MG_Backend/DirectVulkan/Renderer/WireFramebuffer.inc index b489b1b9..779c96c8 100644 --- a/MobileGL/MG_Backend/DirectVulkan/Renderer/WireFramebuffer.inc +++ b/MobileGL/MG_Backend/DirectVulkan/Renderer/WireFramebuffer.inc @@ -116,8 +116,8 @@ // that exists for the device WITHOUT them, which is where the session used to die at // `Magma:multisample-depth-resolve-capability` - would never execute under any lane. The // knob drops the extension arm. It does not pretend the extension is missing anywhere else: - // nothing but the arm choice reads it. - static Bool MagmaWireForcedShaderDepthResolve() { + // nothing but the arm choice reads it. Inline, so the renderer reads the variable once. + inline Bool MagmaWireForcedShaderDepthResolve() { static const Bool forced = [] { const char* value = std::getenv("MGITEST_MAGMA_FORCE_SHADER_DEPTH_RESOLVE"); return value && *value && value[0] != '0';