Skip to content

feat(libSceAgc): implement ACB flips and rendering waits - #1585

Closed
EdouardSence wants to merge 1 commit into
boykopovar:mainfrom
EdouardSence:feat/agc-acb-flip
Closed

EdouardSence wants to merge 1 commit into
boykopovar:mainfrom
EdouardSence:feat/agc-acb-flip

Conversation

@EdouardSence

Copy link
Copy Markdown
Contributor

What

Implements sceAgcAcbSetFlip and sceAgcAcbWaitUntilSafeForRendering. They write the same packets as their DCB counterparts, sceAgcDcbSetFlip and sceAgcDcbWaitUntilSafeForRendering. Both are the driver's flip (NOP 0x17) and rendering wait (NOP 0x06) packets.

The signatures match the existing declarations and SharpProspero: (buffer, videoOutHandle, displayBufferIndex, flipMode, flipArg) and (buffer, videoOutHandle, displayBufferIndex).

Driver change: Pm4.cpp rejected both packets outside queue 0 ("graphics packet in compute queue"). They are now accepted on compute queues. Everything they need runs through the same Submit path for every queue:

  • waitForFlipRoom and reserveOutputs at submit time.
  • The flip and rendering wait execution in PacketExecution.cpp.

Library progress: +2.

Tested

Linux (CachyOS, GCC), RX 9070 XT:

  • agc_driver_flip: the old check expected a flip on queue 0x20 to throw. It is replaced by a positive case: a rendering wait followed by a flip, submitted with sceAgcDriverSubmitAcb(0x20, ...). The test checks that the output captured the wait for the right buffer and presented the flip. The test output now implements CaptureRenderingWait.
  • agc_commands: the ACB packets match the expected words and the DCB flip byte for byte.
  • Full ctest: 458/458.
  • tools/check_conventions.py passes.

Not tested in a title. Astro Bot (PPSA21567), the only title I have, does not import either function. I checked its import NIDs.

The order between a compute-queue flip and graphics work submitted on other queues is left to the title's own synchronization, as for any cross-queue dependency.

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. The code, tests and this description were written by Claude (Claude Code) on my machine.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Oct 8, 2026

Copy link
Copy Markdown

Progress report (033a463 → 60f44b7)

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

✅ 2 implemented
Library Name
libSceAgc sceAgcAcbSetFlip
libSceAgc sceAgcAcbWaitUntilSafeForRendering

@github-actions github-actions Bot added the agc libSceAgc* label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
#1745 core/libs/prx/libSceAgcDriver/tests/Flip.cpp L82

@EdouardSence

Copy link
Copy Markdown
Contributor Author

On the overlap with #1745: the conflict is only in tests/Flip.cpp. Both PRs give the test Output a CaptureRenderingWait override and an IRenderingWait class. The code changes don't overlap.

If #1745 lands first, I'll rebase this PR onto its RenderingGate, which is open by default. I'll add only what the compute-queue case checks: the captured buffer index (waited == 3). If this one lands first, #1745 can do the same in reverse.

Written by Claude (AI assistant) on a contributor's machine.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: no title is shown to reach sceAgcAcbSetFlip or sceAgcAcbWaitUntilSafeForRendering on main (same as #1052). Please reopen with the title ID and the log line if you find one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants