fix(vulkan): drop frame when vkAcquireNextImageKHR times out or is not ready #5863

Closed
adhimiw wants to merge 1 commit from upstream-pr/5863 into main
adhimiw commented 2026-10-14 14:04:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adhimiw on 2026-10-14T14:04:31Z.


What

When running under Wayland compositors or during heavy background asset loading and workspace switches, vkAcquireNextImageKHR can return VK_TIMEOUT or VK_NOT_READY when a new swapchain image is not immediately available. Previously, check(acquired, "vkAcquireNextImageKHR") threw an unhandled exception and crashed the process.

This change treats VK_TIMEOUT and VK_NOT_READY identically to frame-drop conditions by returning false from VulkanDevice::AcquireImage(), allowing the presentation loop to cleanly proceed and acquire an image on the subsequent frame without crashing.

Tested

Tested on Linux x86_64 with NVIDIA GeForce RTX 4050 Laptop GPU (Vulkan 1.4, Wayland/Hyprland). Verified that rapid workspace changes and background rendering intervals no longer crash the Vulkan presentation pipeline.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • Generic behaviour, not specific to one title
  • Depends on: None
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4859118621 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5863). Originally posted by [adhimiw](https://github.com/adhimiw) on 2026-10-14T14:04:31Z. --- ### What When running under Wayland compositors or during heavy background asset loading and workspace switches, `vkAcquireNextImageKHR` can return `VK_TIMEOUT` or `VK_NOT_READY` when a new swapchain image is not immediately available. Previously, `check(acquired, "vkAcquireNextImageKHR")` threw an unhandled exception and crashed the process. This change treats `VK_TIMEOUT` and `VK_NOT_READY` identically to frame-drop conditions by returning `false` from `VulkanDevice::AcquireImage()`, allowing the presentation loop to cleanly proceed and acquire an image on the subsequent frame without crashing. ### Tested Tested on Linux x86_64 with NVIDIA GeForce RTX 4050 Laptop GPU (Vulkan 1.4, Wayland/Hyprland). Verified that rapid workspace changes and background rendering intervals no longer crash the Vulkan presentation pipeline. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [x] Generic behaviour, not specific to one title - [x] Depends on: None - [x] AI-assisted: yes
MarcZX10 commented 2026-10-14 14:11:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T14:11:23Z.


I checked this against current main (69e7138ac). The same VK_NOT_READY / VK_TIMEOUT handling is already present from merged #4684, which also increments presentCounters.acquireDrops; git blame attributes the guard to 37d9ef1. This PR’s base bb7e47a predates that code, and GitHub currently reports the branch dirty. Please rebase against current main and check whether any distinct change remains; this timeout behavior itself is already covered.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6170363204 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5863#issuecomment-6170363204). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T14:11:23Z. --- I checked this against current `main` (`69e7138ac`). The same `VK_NOT_READY` / `VK_TIMEOUT` handling is already present from merged [#4684](https://github.com/boykopovar/AnyPS5/pull/4684), which also increments `presentCounters.acquireDrops`; `git blame` attributes the guard to `37d9ef1`. This PR’s base `bb7e47a` predates that code, and GitHub currently reports the branch dirty. Please rebase against current `main` and check whether any distinct change remains; this timeout behavior itself is already covered.
adhimiw commented 2026-10-14 15:25:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adhimiw on 2026-10-14T15:25:38Z.


Okay sorry 😞

On Wed, 14 Oct, 2026, 7:41 pm MarcZX10, @.***> wrote:

MarcZX100 left a comment (boykopovar/AnyPS5#5863)
https://github.com/boykopovar/AnyPS5/pull/5863#issuecomment-6170363204

I checked this against current main (69e7138ac). The same VK_NOT_READY /
VK_TIMEOUT handling is already present from merged #4684
https://github.com/boykopovar/AnyPS5/pull/4684, which also increments
presentCounters.acquireDrops; git blame attributes the guard to 37d9ef1.
This PR’s base bb7e47a predates that code, and GitHub currently reports
the branch dirty. Please rebase against current main and check whether
any distinct change remains; this timeout behavior itself is already
covered.

—
Reply to this email directly, view it on GitHub
https://github.com/boykopovar/AnyPS5/pull/5863?email_source=notifications&email_token=A46NXVNMUHU7CYKNOXMWXVT5T6CSFA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMJXGAZTMMZSGA2KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-6170363204,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/A46NXVIPBK64UFYRIW6Z4CL5T6CSFAVCNFSNUABGKJSXA33TNF2G64TZHMYTGMRSGI2TANRWGY5US43TOVSTWNJYGQ4TENZQGY3DHILWAI
.
You are receiving this because you authored the thread.Message ID:
@.***>

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6171874184 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5863#issuecomment-6171874184). Originally posted by [adhimiw](https://github.com/adhimiw) on 2026-10-14T15:25:38Z. --- Okay sorry 😞 On Wed, 14 Oct, 2026, 7:41 pm MarcZX10, ***@***.***> wrote: > *MarcZX100* left a comment (boykopovar/AnyPS5#5863) > <https://github.com/boykopovar/AnyPS5/pull/5863#issuecomment-6170363204> > > I checked this against current main (69e7138ac). The same VK_NOT_READY / > VK_TIMEOUT handling is already present from merged #4684 > <https://github.com/boykopovar/AnyPS5/pull/4684>, which also increments > presentCounters.acquireDrops; git blame attributes the guard to 37d9ef1. > This PR’s base bb7e47a predates that code, and GitHub currently reports > the branch dirty. Please rebase against current main and check whether > any distinct change remains; this timeout behavior itself is already > covered. > > — > Reply to this email directly, view it on GitHub > <https://github.com/boykopovar/AnyPS5/pull/5863?email_source=notifications&email_token=A46NXVNMUHU7CYKNOXMWXVT5T6CSFA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMMJXGAZTMMZSGA2KM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-6170363204>, > or unsubscribe > <https://github.com/notifications/unsubscribe-auth/A46NXVIPBK64UFYRIW6Z4CL5T6CSFAVCNFSNUABGKJSXA33TNF2G64TZHMYTGMRSGI2TANRWGY5US43TOVSTWNJYGQ4TENZQGY3DHILWAI> > . > You are receiving this because you authored the thread.Message ID: > ***@***.***> >
github-actions[bot] commented 2026-10-15 12:10:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:10:36Z.


Some 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.

Pull request Shared files not compared
#1395 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#2434 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#3891 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4040 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4048 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4072 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4156 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4396 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4397 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4422 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4423 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4424 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4472 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4520 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4521 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4522 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4523 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4566 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4599 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4650 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4718 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4740 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4749 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4760 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4813 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4847 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#4891 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5021 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5390 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5431 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5441 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5480 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5499 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5800 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5804 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5875 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5905 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5907 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5925 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#5998 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6012 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6054 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6146 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6174 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6177 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6188 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6202 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6210 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6222 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6246 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6249 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6259 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6262 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6290 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6292 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6324 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6360 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
#6372 core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6191721306 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5863#issuecomment-6191721306). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:10:36Z. --- <!-- pr-overlap --> Some 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. | Pull request | Shared files not compared | |---|---| | #1395 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #2434 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #3891 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4040 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4048 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4072 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4156 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4396 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4397 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4422 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4423 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4424 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4472 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4520 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4521 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4522 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4523 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4566 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4599 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4650 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4718 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4740 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4749 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4760 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4813 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4847 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #4891 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5021 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5390 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5431 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5441 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5480 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5499 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5800 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5804 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5875 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5905 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5907 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5925 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #5998 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6012 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6054 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6146 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6174 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6177 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6188 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6202 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6210 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6222 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6246 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6249 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6259 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6262 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6290 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6292 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6324 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6360 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` | | #6372 | `core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp` |
adriadam10 commented 2026-10-15 13:48:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-15T13:48:15Z.


Closing as a duplicate: current main already handles VK_NOT_READY / VK_TIMEOUT in VulkanDevice::AcquireImage() (VulkanDevice.cpp:2994, merged in #4684, which also counts presentCounters.acquireDrops). This PR's three lines are the same guard, and the branch conflicts with main.

Feel free to reopen rebased if a case remains that main still crashes on, ideally with the failing call and log.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6193638884 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5863#issuecomment-6193638884). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-15T13:48:15Z. --- Closing as a duplicate: current `main` already handles `VK_NOT_READY` / `VK_TIMEOUT` in `VulkanDevice::AcquireImage()` (`VulkanDevice.cpp:2994`, merged in #4684, which also counts `presentCounters.acquireDrops`). This PR's three lines are the same guard, and the branch conflicts with `main`. Feel free to reopen rebased if a case remains that `main` still crashes on, ideally with the failing call and log.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5863
No description provided.