fix(agc): drop a presentation instead of waiting for a swapchain image #4684
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4684"
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 XairRrR on 2026-10-12T18:58:30Z.
What
Follow-up to #4106, as @fma-rc suggested there.
The presenter acquired the next swapchain image with a 5 s timeout before completing the guest's flip. With FIFO on Wayland, NVIDIA's driver hands out about one image per second while the window is hidden (on another workspace or occluded).
vkAcquireNextImageKHRthen blocked for about 1 s per flip, and the title ran at exactly 1 frame per second. Stack snapshots showed the presenter indrmSyncobjTimelineWaitunderAcquireImagein every snapshot taken during such a stall, and in none outside them.The acquire no longer waits.
VK_NOT_READYorVK_TIMEOUTdrops that presentation, as an out-of-date swapchain already does, and the flip completes. The[present]line ofAPS5_PROFILE_DRAWcounts the drops.ANYPS5_PRESENT_MODEfrom #4106 stays the explicit switch. This changes the default path, so FIFO no longer ties the guest to a hidden window.Tested
BUILD_TESTING=ON.2a5eca11c. Full ctest: 959/959. Conventions check passed.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-13T03:54:43Z.
I ran this with Astro's Playroom (PPSA01325) on a hidden Hyprland workspace, RTX 5080 with NVIDIA 615.78.08,
ANYPS5_PRESENT_MODE=fifo, onmain2a55cfe1eplus PR 4500 (the title needs it to enter the level).Without the change the title made 414 frames in 420 s and was still on the title screen when the run ended. With
9d7ad5349on top it reached the level at 78 s and made 122 frames in 20.3 s in gameplay, the same rate I measure withimmediate.The
[present]line with the change reads10 presents over 10 s (50 dropped: no free swapchain image; ...). One thing to look at: the per-present figures in that line are still divided by the presents that got an image, so it printsGPU busy 278.9 msper present where the run without drops prints 52.2 ms.I did not run it with the window visible.
Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-13T11:34:33Z.
Thanks for the Astro's Playroom run on a hidden workspace.
You're right about the
[present]line. GPU busy and idle time cover every frame's GPU work, but they were divided only by the presentations that got an image.95f34a050divides those two figures by presented plus dropped frames, and the label now reads "per frame, presented or dropped". The per-present blit figures are unchanged. With no drops, nothing changes.The branch is rebased on current
main. Full ctest: 1036/1036, conventions pass.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T15:16:07Z.
Checked the diff and the acquire path: the acquire fence is reset at the start of every
AcquireImage,imageAcquiredis not set on theVK_NOT_READY/VK_TIMEOUTearly return, andDriver::Presentalready treats afalsereturn as a dropped presentation. Scoped build and ctest of libSceAgcDriver pass (488/489;agc_driver_tessellationsegfaults with and without this PR). Hidden-window behaviour confirmed by @fma-rc on Astro's Playroom; merging.