feat(libs): resolve command-buffer flip buffers when the GPU reaches the flip #2204

Merged
XairRrR merged 1 commit from upstream-pr/2204 into main 2026-10-10 07:59:35 +00:00
XairRrR commented 2026-10-09 11:29:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-09T11:29:50Z.


What

Uncharted: Legacy of Thieves Collection (PPSA05684) stops on main with:

VideoOut: flip buffer is not registered

Its renderer submits a DCB flip of buffer 0 while another thread waits for sceVideoOutIsFlipPending to reach 0 before registering the buffers. The buffer was looked up when the command buffer was submitted; it is now resolved in FlipRequest::GpuReady, when the GPU reaches the flip. A flip whose buffer is still unregistered then presents black and completes (flip event, count, flipPendingNum). The console's behaviour in that case is unknown and recorded in TechnicalDebt.

Tested

Arch Linux, GCC 16.2.1, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.71.09).

  • The branch alone on current main (d70b8998): tools/check_conventions.py passes; of the 513 ctest tests all pass except agc_driver_dcc_keys_first_write, which fails the same way on main (an unchanged pending image was uploaded again). agc_driver_storage_cache_budget passes run alone; under ctest -j8 a local 3 GB RSS limit stopped it.
  • Uncharted: Legacy of Thieves Collection (PPSA05684): with this and the other changes of its bring-up, the title boots past the stop quoted above and reaches its main menu.
  • the new video_out_flip_tests modes deferred and unregistered pass, run by hand (the binary is not registered in ctest).

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
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4799798792 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2204). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-09T11:29:50Z. --- ### What Uncharted: Legacy of Thieves Collection (PPSA05684) stops on `main` with: ``` VideoOut: flip buffer is not registered ``` Its renderer submits a DCB flip of buffer 0 while another thread waits for `sceVideoOutIsFlipPending` to reach 0 before registering the buffers. The buffer was looked up when the command buffer was submitted; it is now resolved in `FlipRequest::GpuReady`, when the GPU reaches the flip. A flip whose buffer is still unregistered then presents black and completes (flip event, count, `flipPendingNum`). The console's behaviour in that case is unknown and recorded in TechnicalDebt. ### Tested Arch Linux, GCC 16.2.1, NVIDIA GeForce RTX 4070 Ti SUPER (driver 615.71.09). - The branch alone on current `main` (d70b8998): `tools/check_conventions.py` passes; of the 513 ctest tests all pass except `agc_driver_dcc_keys_first_write`, which fails the same way on `main` (`an unchanged pending image was uploaded again`). `agc_driver_storage_cache_budget` passes run alone; under `ctest -j8` a local 3 GB RSS limit stopped it. - Uncharted: Legacy of Thieves Collection (PPSA05684): with this and the other changes of its bring-up, the title boots past the stop quoted above and reaches its main menu. - the new `video_out_flip_tests` modes `deferred` and `unregistered` pass, run by hand (the binary is not registered in ctest). ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
popcoder565 commented 2026-10-09 15:24:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:24:48Z.


Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head 9695f2c8, merged onto main d70b8998 in one build with 33 other AGC/shader PRs that had no Windows run.

  • The test change is in video_out_flip_tests, which isn't in ctest. On main it aborts on Windows with an uncaught VideoOut: port is closed (#1040, which #1225 addresses), so I couldn't check this PR's test here.
  • Full ctest in that build: 514 of 515. The one failure is #2257's new test, which is registered without the Windows PATH setup.

No title was run.

🤖 Addressed by Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083912720 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2204#issuecomment-6083912720). Originally posted by [popcoder565](https://github.com/popcoder565) on 2026-10-09T15:24:48Z. --- Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head `9695f2c8`, merged onto `main` d70b8998 in one build with 33 other AGC/shader PRs that had no Windows run. - The test change is in `video_out_flip_tests`, which isn't in ctest. On `main` it aborts on Windows with an uncaught `VideoOut: port is closed` (#1040, which #1225 addresses), so I couldn't check this PR's test here. - Full ctest in that build: 514 of 515. The one failure is #2257's new test, which is registered without the Windows `PATH` setup. No title was run. _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_
oneandonlydean commented 2026-10-10 01:36:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T01:36:28Z.


This conflicts with main after today's merges; could you rebase? It passed testing and is otherwise ready.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6092248630 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2204#issuecomment-6092248630). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T01:36:28Z. --- This conflicts with main after today's merges; could you rebase? It passed testing and is otherwise ready.
adriadam10 commented 2026-10-10 07:56:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T07:56:56Z.


Rebased onto current main as @oneandonlydean asked (conflicts in VideoOutDriver.cpp with the overlay-bus/CheckAlive changes, the mode list in tests/Flip.cpp, and a TechnicalDebt adjacency). The PR's logic is unchanged.

Checked after the rebase: libSceVideoOut build + ctest (10/10), and video_out_flip_tests modes deferred, unregistered and overlay run by hand pass. Without the src change, deferred and unregistered fail with VideoOut: flip buffer is not registered. Windows result from @popcoder565 above. Merging on green CI.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095365298 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2204#issuecomment-6095365298). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T07:56:56Z. --- Rebased onto current `main` as @oneandonlydean asked (conflicts in `VideoOutDriver.cpp` with the overlay-bus/`CheckAlive` changes, the mode list in `tests/Flip.cpp`, and a TechnicalDebt adjacency). The PR's logic is unchanged. Checked after the rebase: libSceVideoOut build + ctest (10/10), and `video_out_flip_tests` modes `deferred`, `unregistered` and `overlay` run by hand pass. Without the `src` change, `deferred` and `unregistered` fail with `VideoOut: flip buffer is not registered`. Windows result from @popcoder565 above. Merging on green CI.
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!2204
No description provided.