Repository navigation
Conversation
Tyrannys
left a comment
There was a problem hiding this comment.
Independent verification of head b8486b4a5 on profile M: RTX 4070 SUPER 12 GB, NVIDIA 621.01, Windows 11, Ryzen 7 9800X3D. MSVC RelWithDebInfo.
- Negative control,
main39f52f39c:ctest -C RelWithDebInfo --output-on-failure -R "^xbox_present$"failed 2 of 2 runs, atline 1226: present_planes(&one, 1)(case F, window resize). So this is not just an RTX 5070 issue: the 4070 SUPER on 621.01 hits it too. - With this PR (merged on
39f52f39ctogether with #2505, which only touches a compile-pool test):ctest -C RelWithDebInfo --output-on-failure -R "^(xbox_present|d3d12_present)$"passed 3 of 3 runs (xbox_present2.95-4.06 s,d3d12_present1.62-1.97 s). The resize case is part ofxbox_present, and it ran on the card. - Code read:
pending_capture_(disk capture) is still set only for a shown present.captured_is now also set forVK_ERROR_OUT_OF_DATE_KHR, but only aftervkQueueSubmitsucceeded, so the copy intocapture_buffer_was really queued.VK_ERROR_SURFACE_LOST_KHRstill clears it.
Clean. Approving. No game files used.
AI-assisted (Claude Code).
|
Reviewed at head Verification
Notes (non-blocking)
Approve. AI-assisted review + local MSVC/dual-GPU verification. |
|
#2507 | head b8486b4 (merged cleanly with main 48bae6c — no conflicts on current |
timbot103
left a comment
There was a problem hiding this comment.
Reviewed head b8486b4a5 by static inspection only, with no builds or GPU runs.
In runtime/src/vulkan_present.h:650, the copy submission succeeds before vkQueuePresentKHR runs. The capture path orders staging writes, makes them visible to the host, and transitions the image to PRESENT_SRC_KHR in runtime/src/vulkan_present.h:1336. The patch records the copied extent and format for VK_ERROR_OUT_OF_DATE_KHR, and read_back() still waits for that submission's fence before reading the bytes in runtime/src/vulkan_present.h:364.
VK_SUCCESS and VK_SUBOPTIMAL_KHR still qualify for disk sampling. An out-of-date or suboptimal present marks the swapchain stale, and recreation waits for the queue to idle before replacing its image semaphores and capture storage. Surface loss follows its existing recovery path and clears capture validity. Other present errors leave the new capture unpublished.
Case F in runtime/test/xbox_present_test.cpp:1212 already verifies readback and pixel contents across resizes, including the settled extent. The exact WSI result during resize depends on the driver. No findings.
AI-assisted.
Summary
Fixes a regression from
9f98dcc61(RT-POST-LOAD-GPU-MEMORY) inVulkanPresenter::submit_now()(runtime/src/vulkan_present.h) that brokexbox_presentcase F (xbox_present_test.cpp:1226) on NVIDIA RTX 5070 during window resize.When the window is resized between presents,
vkQueuePresentKHRon Windows/NVIDIA can returnVK_ERROR_OUT_OF_DATE_KHRafter the command buffer -- including thevkCmdCopyImageToBuffertransfer intocapture_buffer_-- has already been submitted (submitted == VK_SUCCESS).submit_now()still returnsVK_SUCCESS, andxbox_present_test.cpp:1224explicitly expects the composed frame to remain readable throughread_back().Commit
9f98dcc61clearedcaptured_ = falsebefore submission and moved thecaptured_ = trueassignment insideif (result == VK_SUCCESS || result == VK_SUBOPTIMAL_KHR). As a result, anyVK_ERROR_OUT_OF_DATE_KHRfromvkQueuePresentKHRleftcaptured_ == falseand causedread_back()to fail.This change:
pending_capture_ = frame.done) gated onVK_SUCCESS || VK_SUBOPTIMAL_KHRso only shown frames are written to disk.captured_,captured_extent_, andcaptured_format_whenevercopy_frame && capture_ptr_ran andresultisVK_SUCCESS,VK_SUBOPTIMAL_KHR, orVK_ERROR_OUT_OF_DATE_KHR(leavingVK_ERROR_SURFACE_LOST_KHRand other failures uncaptured).Verification
main39f52f39c):ctest --output-on-failure -R ^xbox_present$failed deterministically atxbox_present_test.cpp:1226(line 1226: present_planes(&one, 1)) during case F window resize (320x240 -> 400x300).ctest --output-on-failure -R ^(xbox_present|d3d12_present)$: 2/2 passed (d3d12_present1.45 s,xbox_present2.76 s).python -I scripts/check_no_game_data.py runtime/src/vulkan_present.h: pass.python -I tests/test_ctest_registration.py -v: pass.git diff --check: clean;git merge-treeclean against open PRs Preserve sRGB midtones on the SDR UNORM swapchain fallback #2001 and Treat BGRX overlays as opaque in PresentX composition #2014.Claimed in #1608 (comment) (
RT-PRESENT-RESIZE-READBACK). No game files used.GPUs tested: NVIDIA GeForce RTX 5070 12 GB (Windows 11, driver 610.88, Vulkan 1.4.341;
VK_LAYER_KHRONOS_validationnot installed locally).AI-assisted (Antigravity, Gemini).