From 8af6ebc174ae8b38099c4b74db4802eb864a8722 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Tue, 11 Aug 2026 20:59:25 -0400 Subject: [PATCH] [Fix] (MG_State): seed uniform initializers through the phase-A gate, not off the raw artifact block --- MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp b/MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp index d8750824..0a572a3e 100644 --- a/MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp +++ b/MobileGL/MG_State/GLState/ProgramState/ProgramObject.cpp @@ -141,7 +141,11 @@ namespace MobileGL::MG_State::GLState { // phase-B publish, so re-entering the join gate is not available, and the location space // reflection assigns (one location per array element) is all that is needed. void ProgramObject::ApplyUniformInitialValues() const { - const auto& initializers = m_artifacts.uniformInitialValues; + // Through the phase-A gate, not off m_artifacts directly: phase B can be joined by a + // caller that has not read anything phase A publishes yet, and reading the raw field + // there would find the PREVIOUS link's block (or an empty one) and drop every + // initializer without a trace. Artifacts() is a no-op once phase A is in. + const auto& initializers = Artifacts().uniformInitialValues; if (initializers.empty()) return; if (m_spirv.globalUboScratch.empty() || m_spirv.uniformOffsets.empty()) { // Phase B published no shadow (cancelled, or superseded by a relink). The program