fix(agc-driver): make the presenter wait for a full frame dump queue #8807
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8807"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by ycbuzi on 2026-10-21T01:41:57Z.
What
With
APS5_DUMP_FRAMES,FrameDumpWriter::Enqueuethrewframe dump queue exceeded 64 MiBas soon as the writer thread was more than 64 MiB behind, which failed the presentation and ended the title. #4320 made that rare at the defaultAPS5_DUMP_SCALE=4and left the limit itself alone ("if the queue should make the presenter wait for the writer instead of throwing when it is full, that is a different change"). AtAPS5_DUMP_SCALE=1a 1920x1080 title reaches it within nine frames on this PC (8 MB a frame, one BMP written before the ninth frame arrives), a 3840x2160 one on its third frame.Enqueuenow waits on the writer's condition variable until the frame fits and the writer notifies after each file, so a slow disk slows the title down instead of stopping it. A single frame larger than the queue still throws. The disabled-dump early return moves before the check, as before nothing was queued in that case either.The VideoOut frame dump queue test gets a
waitmode, registered asvideo_out_frame_dump_waitwithAPS5_DUMP_SCALE=1: two 3840x2160 frames fill the queue, the third has to wait for the held first file, which a thread releases after two seconds, and the test checks that the four flips took at least 1.5 s and that every dump matches the display buffer. Onmainthat run fails with the queue message at the third flip.docs/dev/GAME_TESTING.mdsays what the wait means for a dump.Tested
Windows 11, MinGW GCC 15.2.0, RTX 4070, DOOM (PPSA99666, 1920x1080 display buffers) relinked with
--windows --skip-sce-module, test plangame freedoom2.wad/frames 240,APS5_DUMP_FRAMES=240:APS5_DUMP_SCALE=1APS5_DUMP_SCALE=4maina841f2a (has #4320)[videoout] presentation failed: Vulkan presentation: frame dump queue exceeded 64 MiB, 1 of 240 BMPs writtenThe change was built into that tree's
libSceAgcDriver.prx(the writer class is the same there apart from #4891's screenshot flag); the PR branch is on currentmain.Not run:
video_out_frame_dump_waitand its sibling need Linux with the x11 test driver (mkfifo), which this PC does not have; CI shows them as skipped with the offscreen driver, as #4320 described.python tools/check_conventions.py --base origin/main --head HEADpasses. When the presenter is slower than the title, flips are coalesced as before this change: on a loaded CPU one run presented 52 of 240 flips and dumped those 52.tools/pr_overlap.py: #7622 (host worker MXCSR) changes the line that starts the writer thread, right below this change, so whichever merges second rebases a one-line hunk; the other open PRs onVulkanDevice.cpptouch other regions, or could not be compared because they conflict withmain.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T01:45:10Z.
Review: APPROVED
Reviewed the exact diff. Enqueue now rejects a single frame larger than the queue, waits until capacity is available, and wakes blocked presenters after bytes are written or shutdown starts. The existing accounting includes frames being written as well as pending frames, so this remains a 64 MiB bound. The new test holds the writer on the first dump while the presenter fills the queue, then verifies it waits and that the dumped buffers remain correct. The reported Windows control demonstrates the failure on main at scale 1 and unchanged behavior at scale 4; hosted runtime jobs are skipped, so I rely on that reported run and the test design. No blocking issue found.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T01:53:25Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppL167-168Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceVideoOut/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceVideoOut/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceVideoOut/CMakeLists.txtcore/libs/prx/libSceVideoOut/tests/FrameDumpQueue.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceVideoOut/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceVideoOut/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cppcore/libs/prx/libSceVideoOut/CMakeLists.txt