headless: end and restart the host frame each emulated frame

The app opens a host frame, runs one frame and closes it again, but headless
opened a single one around the whole run. All of the GPU's per-frame work hangs
off BeginHostFrame - the texture cache's StartFrame and the framebuffer
manager's BeginFrame, which is what decimates FBOs - so none of it ran here at
all, and a long run decayed nothing.

That isn't only a rendering difference: the framebuffer state it maintains
decides whether gpu->PerformMemoryCopy claims a copy, and a claimed copy skips
the write to emulated memory entirely. So a stale cache could change what a
game sees in RAM, not just on screen.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
This commit is contained in:
Henrik RydgårdandClaude Opus 5 committed 2026-09-17 13:29:28 -06:00
1 parent 5cfd859eae
commit 0c926a337b
1 file changed
+8
+8
View File
@@ -400,6 +400,14 @@ static bool RunAutoTest(GraphicsContext *graphicsContext, CoreParameter &corePar
if (coreState == CORE_NEXTFRAME) {
// INFO_LOG(Log::System, "(frame)");
coreState = CORE_RUNNING_CPU;
// Close and reopen the host frame, which is what the app does once per displayed
// frame. All the GPU's per-frame work hangs off BeginHostFrame - the texture cache's
// StartFrame and the framebuffer manager's DecimateFBOs - so with a single host frame
// spanning the whole run, none of it ever ran here, and a long test decayed nothing.
if (gpu) {
gpu->EndHostFrame();
gpu->BeginHostFrame(g_Config.GetDisplayLayoutConfig(DeviceOrientation::Landscape));
}
}
if (coreState == CORE_STEPPING_CPU && !coreParameter.startBreak) {
break;