Repository navigation
present: LEONIDA_PRESENT_DUMP writes the presented image to a PNG every N frames (RT-5 blank-window diagnosis) - #9419
Roberto0953 wants to merge 1 commit into
Conversation
…resenter shows to a PNG every N frames Opt-in diagnostic for the retail boot's blank-window stop: after the final blit or plane composition the presenter copies the sampled swapchain image to a host-visible buffer, and once the frame's fence signals a worker writes present_<frame>.png (standard-library PNG encoder). vk_present_dump_test checks the pixels on a real Vulkan device. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested 014d99f on RTX 4070 SUPER, NVIDIA 621.01, Windows 11 Pro: pass
|
|
checked: #9419014d99f | base: exact PR head, parent 6312c05 | on: native Windows 11 Pro 10.0.26300, RTX 5060 Ti, NVIDIA 621.14 / 32.0.16.2114, MSVC 19.44.35230.0, SDK 10.0.26100.0, CMake 3.31.6-msvc6, VS 2022 x64 RelWithDebInfo | result: PASS, no local source edits. Built
The dump fixtures wrote frames 1/3 and 1/61 respectively and passed their independent WIC PNG decoding / all-pixel comparisons (solid orange, then composed black lower half). The invalid interval produced its diagnostic and no output folder, as checked by the test. Khronos validation layer is not installed here; |
|
Tested Overlap with #8019. This PR adds the same capture-buffer Unrelated to this PR: AI-assisted (Claude Code). No game files. |
|
Checked the production PNG writer on 014d99f with a temporary synthetic test. Windows Imaging Component independently decoded six 3×2 PNGs. All 36 RGBA pixels matched the expected channel bytes.
Synthetic inputs only. AI-assisted with Codex. Claim: #9401 (comment) |
|
Tested on AMD Radeon RX 7700 XT (RDNA3), AMD Windows driver 32.0.32029.2010, Windows 11, MSVC 14.51 Release, at 014d99f. Full No regression. The only failures are the same 5 as on AI-assisted (Claude Code). |
|
Heads tested: PR head 014d99f, main 5d74c27; merged tree e4676c92e (clean merge). C++/Windows/Vulkan change — not runnable here; review-only with CI as the execution gate. Review: every referenced symbol and header exists in the merged tree (testfiles::ScratchDir, png_io ReadPngFile/PixelSurface, vk_test_device, VulkanPresenter present/present_blank/present_planes/composed_presents); new CMake targets gated behind WIN32 AND BUILD_TESTING with SKIP_RETURN_CODE 77; the PNG writer's stored-deflate/adler32/CRC framing is correct on inspection; publish() creates the sibling with wb/x (exclusive) then renames, so the hard-link sentinel case the test constructs cannot be clobbered; capture_size_ switches to texel_size(format) with a disable-and-continue fallback for unknown formats, preserving capture_'s four-bytes-per-texel promise; a host-read barrier is added before the CPU read. The docs row makes LEONIDA_PRESENT_DUMP satisfy test_docs_env_vars (that suite's only failure is the pre-existing main-side LEONIDA_TLS_GA_PATCH one). Side effect worth noting: scripts/build_runtime.ps1 now lists shims\xg_xs.cpp, and test_build_runtime_fallback is GREEN on the merged tree (Ran 8, OK; clean main @5d74c2723 still fails it, #6891 family) — this PR incidentally repairs that main-side red. Python-side suites that parse the changed files (ctest_registration, build_runtime_cmake/batch/fallback, cmake_vulkan_missing): all OK on the merged tree. check_no_game_data exit 0. Flags: CI pending at verification time; docs/d3d12_vulkan.md also touched by open #7078/#6964/#7110 and batchmate #9413 — pairwise merge-trees all clean. AI-assisted: yes. Tested on Linux (RTX 5080 host), CPU-only run. |
|
Validated complete head Windows x64, RTX 4080, Vulkan validation enabled, fresh TEMP/TMP per case:
All native cases above recorded 0 VUIDs. The CPU capture-color/readback-size tests also passed. This is full-head integration validation using synthetic images only; no game data is included. Built with MSVC / Visual Studio 2022, RelWithDebInfo. Tested source: https://github.com/Hiiva/Leonida/tree/work/exe-reviewed-bd8b17d5 |
Claimed in the coordination issue: #9235 (comment) (RT-5 follow-up).
What and why
Several retail boots now reach "frame loop runs,
PresentXS_OK, window white" (#8851). A screen capture of that window doesn't work:ShowWindow/PrintWindowblock on the presenter's window, which has no message loop, andCopyFromScreensees whatever is on top. So nobody could tell whether a presented frame is empty, cleared or drawn.LEONIDA_PRESENT_DUMP=<dir>[,N](N defaults to 60) writes the image the window presenter actually shows to<dir>/present_<frame:06d>.pngevery N presented frames, the first one included. It covers the consolePresentXpath and the window path throughWindowPresenter::present. The separateIDXGISwapChain::Presentimplementation uses its own swapchain and is not covered.PRESENT_SRC_KHR. Once that frame's fence signals, a worker thread writes the PNG with a standard-library encoder. A sampled frame can stall; the others are untouched.[rt] present: dumped frame N to <path>. It is off by default. A bad value is logged once and disables the dump, and nothing is written outside<dir>.docs/d3d12_vulkan.md).The files stay in the player's folder; nothing of the game goes anywhere else.
Test
Windows 11, MSVC 2022, NVIDIA GeForce RTX 3080 (617.42):
vk_present_dump_test(new) presents known patterns through the presenter on a real Vulkan device, decodes the PNGs and compares every pixel: frame 1 is solid orange, frame 3 has the composed black lower half. The default interval writes frames 1 and 61. An invalid interval logs once and writes nothing.present_000001.pngis missing.tests/test_build_runtime_fallback.py: 8/8 (the fallback list also gets back the missingxg_xs.cppentry).AI-assisted: implemented with OpenAI Codex and reviewed, rebuilt and re-tested with Claude Code (RTX 3080). Synthetic inputs only, no game files.