Headless: Take the timeout screenshot before ending the draw frame

On Vulkan, reading back the display framebuffer after EndDrawFrame hit
the insideFrame_ assert in CopyFramebufferToMemory, so any run that
timed out with --screenshot-save crashed in debug builds.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-09-29 14:05:00 -06:00
1 parent c9c26ce0fd
commit f6e70b88ad
1 file changed
+7 -6
+7 -6
View File
@@ -515,6 +515,13 @@ static bool RunAutoTest(GraphicsContext *graphicsContext, CoreParameter &corePar
gpu->EndHostFrame();
}
// Before EndDrawFrame: Vulkan can only read back a framebuffer inside a frame.
if (!g_screenshotSavePath.empty() && !g_screenshotSaved) {
// SendDebugScreenshot ignores the descriptor and reads the display framebuffer from the GPU
// itself, so there's nothing to fill in here.
SendDebugScreenshot(DebugScreenshotDesc{});
}
if (draw) {
// Vulkan may get angry if we don't do a final present.
if (gpu) {
@@ -527,12 +534,6 @@ static bool RunAutoTest(GraphicsContext *graphicsContext, CoreParameter &corePar
EndDrawFrame(draw);
}
if (!g_screenshotSavePath.empty() && !g_screenshotSaved) {
// SendDebugScreenshot ignores the descriptor and reads the display framebuffer from the GPU
// itself, so there's nothing to fill in here.
SendDebugScreenshot(DebugScreenshotDesc{});
}
PSP_Shutdown(true);
if (!opt.bench) {