From 0c0d375673eb9125bbb8b08a4ccd1f62069363dd Mon Sep 17 00:00:00 2001 From: Shokunin <30949000+tetrisgm@users.noreply.github.com> Date: Mon, 28 Sep 2026 20:32:19 -0700 Subject: [PATCH] GL readback runner: link render_pass_plan.c into the fixture The MinGW fixture compiles gpu_gl_renderer.c (through test_gl_readback_region.c) with only gpu_sw_renderer.c beside it. gl_renderer_shutdown() now releases the render-pass resources, including the VRAM journal's CPU rows, so the PE link left render_pass_journal_free unresolved and the runner returned 2. render_pass_plan.c is self-contained (libc only), so link it rather than stub each journal and policy entry point. Checked with a macOS clang stand-in for gcc.exe/g++.exe (-flto, dead_strip): the branch before this left render_pass_journal_free unresolved; now it links, and the probe then behaves exactly as on master (macOS gives the fixture a GL 2.1 context, so both stop at shader compile). Co-Authored-By: Claude Opus 5.5 --- runtime/tests/run_gl_readback_region.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/runtime/tests/run_gl_readback_region.py b/runtime/tests/run_gl_readback_region.py index 5f4e2a4b..028389be 100644 --- a/runtime/tests/run_gl_readback_region.py +++ b/runtime/tests/run_gl_readback_region.py @@ -66,7 +66,11 @@ def main(): return result fixture = args.fixture or framework / "runtime/tests/test_gl_readback_region.c" - for name, source in [("probe", fixture), ("sw", framework / "runtime/src/gpu_sw_renderer.c")]: + # The renderer's render-pass paths call the journal and VRAM policy in + # render_pass_plan.c (self-contained: no other runtime symbols). + sources = [("probe", fixture), ("sw", framework / "runtime/src/gpu_sw_renderer.c"), + ("rp", framework / "runtime/src/render_pass_plan.c")] + for name, source in sources: if run([compiler / "gcc.exe", "-std=c11", "-O2", "-flto", "-DPSX_SDL3=1", "-DPSX_NO_DEBUG_TOOLS=1", *includes, "-c", source, "-o", dest / (name + ".o")]).returncode: @@ -74,7 +78,7 @@ def main(): libraries = ["m", "kernel32", "user32", "gdi32", "winmm", "imm32", "ole32", "oleaut32", "version", "uuid", "advapi32", "setupapi", "shell32", "dinput8", "opengl32"] - if run([compiler / "g++.exe", "-O2", "-flto", dest / "probe.o", dest / "sw.o", + if run([compiler / "g++.exe", "-O2", "-flto", *[dest / (name + ".o") for name, _ in sources], sdl_library, *["-l" + name for name in libraries], "-o", dest / "probe.exe"]).returncode: return 2