feat(libSceAgc): implement sceAgcAcbSetFlip and sceAgcAcbWaitUntilSafeForRendering #1052

Closed
Kikoarl wants to merge 1 commit from upstream-pr/1052 into main
Kikoarl commented 2026-10-07 04:57:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Kikoarl on 2026-10-07T04:57:11Z.


What

  • Symmetric asynchronous compute (ACB) counterparts to sceAgcDcbSetFlip (PR #494) and sceAgcDcbWaitUntilSafeForRendering. They allocate and write the same Flip (0xc004105c) and RenderingWait (0xc0021018) PM4 packets into the command buffer that the AGC driver consumes across compute and graphics queues (PacketExecution.cpp).
  • Updated docs/dev/TechnicalDebt.md to note packet parity with DCB.

Tested

  • Linux x86_64: ninja -C /tmp/anyps5_build -j$(nproc) and ctest --test-dir /tmp/anyps5_build -R agc_commands --output-on-failure pass 100%.
  • Added unit tests in core/libs/prx/libSceAgc/tests/Commands.cpp verifying packet structure, header, arguments, and buffer allocation failure handling for both sceAgcAcbSetFlip and sceAgcAcbWaitUntilSafeForRendering.

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:4768135393 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1052). Originally posted by [Kikoarl](https://github.com/Kikoarl) on 2026-10-07T04:57:11Z. --- ### What - Symmetric asynchronous compute (ACB) counterparts to `sceAgcDcbSetFlip` (PR #494) and `sceAgcDcbWaitUntilSafeForRendering`. They allocate and write the same Flip (`0xc004105c`) and RenderingWait (`0xc0021018`) PM4 packets into the command buffer that the AGC driver consumes across compute and graphics queues (`PacketExecution.cpp`). - Updated `docs/dev/TechnicalDebt.md` to note packet parity with DCB. ### Tested - Linux x86_64: `ninja -C /tmp/anyps5_build -j$(nproc)` and `ctest --test-dir /tmp/anyps5_build -R agc_commands --output-on-failure` pass 100%. - Added unit tests in `core/libs/prx/libSceAgc/tests/Commands.cpp` verifying packet structure, header, arguments, and buffer allocation failure handling for both `sceAgcAcbSetFlip` and `sceAgcAcbWaitUntilSafeForRendering`. ### 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](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
github-actions[bot] commented 2026-10-07 04:57:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T04:57:31Z.


Progress report (1acbeef → 2b1d97d)

📈 System libraries: 87.35% (+0.07%, +2 implemented functions)

✅ 2 implemented
Library Name
libSceAgc sceAgcAcbSetFlip
libSceAgc sceAgcAcbWaitUntilSafeForRendering
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6031238584 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1052#issuecomment-6031238584). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-07T04:57:31Z. --- <!-- progress-report --> ### Progress report (1acbeef → 2b1d97d) 📈 **System libraries**: 87.35% (+0.07%, +2 implemented functions) <details> <summary>✅ 2 implemented</summary> | Library | Name | | - | - | | libSceAgc | `sceAgcAcbSetFlip` | | libSceAgc | `sceAgcAcbWaitUntilSafeForRendering` | </details>
oneandonlydean commented 2026-10-07 09:00:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-07T09:00:23Z.


Thanks for the PR. I'm closing it for now, for the same reason as #970 and #999: no title is shown to reach sceAgcAcbSetFlip or sceAgcAcbWaitUntilSafeForRendering on main. The description gives DCB symmetry and unit tests, but the owner merges library functions only when a title needs them, shown by the title ID and the log line where it stops on main (here sceAgcAcbSetFlip / sceAgcAcbWaitUntilSafeForRendering hitting NotImplemented).

Two things to settle if it comes back:

  • The signatures are taken from the DCB versions. OpenAGC declares both ACB functions differently (sceAgcAcbSetFlip(uint32_t* acb, uint32_t size_dw, vo_handle, buf_idx, vsync) and sceAgcAcbWaitUntilSafeForRendering(uint32_t* acb, uint32_t size_dw), both returning int32_t), so the arguments a title actually passes would decide which is right.
  • A flip submitted on a compute queue goes through a different queue's ordering than the graphics work that drew the image. "The driver handles both packets the same" needs a title run that shows it presents correctly, not only a packet test.

If a title stops at one of these on main, please reopen it (or open a new PR) with the title ID, that log line and the arguments it passes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6034586987 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1052#issuecomment-6034586987). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-07T09:00:23Z. --- Thanks for the PR. I'm closing it for now, for the same reason as #970 and #999: no title is shown to reach `sceAgcAcbSetFlip` or `sceAgcAcbWaitUntilSafeForRendering` on main. The description gives DCB symmetry and unit tests, but the owner merges library functions only when a title needs them, shown by the title ID and the log line where it stops on main (here `sceAgcAcbSetFlip` / `sceAgcAcbWaitUntilSafeForRendering` hitting `NotImplemented`). Two things to settle if it comes back: - The signatures are taken from the DCB versions. OpenAGC declares both ACB functions differently (`sceAgcAcbSetFlip(uint32_t* acb, uint32_t size_dw, vo_handle, buf_idx, vsync)` and `sceAgcAcbWaitUntilSafeForRendering(uint32_t* acb, uint32_t size_dw)`, both returning `int32_t`), so the arguments a title actually passes would decide which is right. - A flip submitted on a compute queue goes through a different queue's ordering than the graphics work that drew the image. "The driver handles both packets the same" needs a title run that shows it presents correctly, not only a packet test. If a title stops at one of these on main, please reopen it (or open a new PR) with the title ID, that log line and the arguments it passes.

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!1052
No description provided.