Take output screenshots after the ImGui debugger has drawn

The screenshot readback ran in ScreenManager's post-render callback, and
on Vulkan it ends the backbuffer render step. renderImDebugger() draws
after that, so taking a screenshot with the debugger open made its first
SetViewport() write through a null render step (an assert in debug
builds, a Play crash report in release). Do the readback at the end of
the frame in NativeFrame instead, which also puts the debugger in the
screenshot, and remove the now unused callback.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-25 19:44:21 +01:00
1 parent 2ce1164725
commit 70f205f2ff
3 files changed
+2 -21

No files matched your search

-5
View File
@@ -389,11 +389,6 @@ ScreenRenderFlags ScreenManager::Render(std::function<void()> afterPreRender) {
}
getUIContext()->Flush();
if (postRenderCb_) {
// Really can't render anything after this! Will crash the screenshot mechanism if we do.
postRenderCb_(getUIContext(), postRenderUserdata_);
}
} else {
ERROR_LOG(Log::UI, "No current screen!");
}