[Refactor] (MG_Backend/DirectVulkan): make the renderer's two file-scope singletons inline

This commit is contained in:
2026-10-16 04:20:26 -04:00
parent 01f80b0a0a
commit b0e229f2a3
2 changed files with 5 additions and 4 deletions
@@ -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<DynamicStateShadow> 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<DynamicStateShadow> g_dynamicStateShadow;
// ---- D12.3: DynamicTailKey's inputs against the P2 chunk table ----
//
@@ -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';