Skip to content

feat(libSceAgc): implement sceAgcAcbSetFlip and execute flips on compute queues - #6794

Merged
adriadam10 merged 2 commits into
boykopovar:mainfrom
fma-rc:feat/agc-acb-set-flip
Oct 19, 2026
Merged

adriadam10 merged 2 commits into
boykopovar:mainfrom
fma-rc:feat/agc-acb-set-flip

Conversation

@fma-rc

@fma-rc fma-rc commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

What

Implements sceAgcAcbSetFlip. It writes the same 6-dword flip packet as sceAgcDcbSetFlip. In the PS5 6.00 libSceAgc module both exports are the same 176-byte wrapper around one libSceAgcDriver helper; the only argument that differs selects the release event (CS_DONE for ACB), which our flip packet does not model.

The second commit lets the driver execute that packet on a compute queue. Until now the PM4 validator (Pm4.cpp) accepted a flip only on queue 0 and threw graphics packet in compute queue otherwise. The flip path after validation already handles any queue: it reserves the output, hands it the frame and raises the end-of-pipe interrupt on the submitting queue, the way other compute-queue releases are delivered. Since two workers can now reach the flip, the frame serial became atomic, and a compute flip gets its own frame timing instead of taking queue 0's.

Earlier attempts #1052 and #1585 were closed because no title was shown to reach it. Open PR 6447 writes the same packet for this function among changes to 100 files; this PR is only ACB flips. Death Stranding 2 (PPSA02015) stops on the export on its loading screen, about 1085 s in:

terminate called after throwing an instance of 'std::runtime_error'
  what():  sceAgcAcbSetFlip not implemented

and, with the first commit alone, at 1333 s on the packet it writes:

terminate called after throwing an instance of 'std::runtime_error'
  what():  AGC driver: FLIP at DWORD 0: graphics packet in compute queue

Tested

Linux, on main 6a32550: agc_commands fails on main with sceAgcAcbSetFlip not implemented; agc_driver_flip (new compute-queue case) fails without the second commit with AGC driver: FLIP at DWORD 0: graphics packet in compute queue. Both pass with this PR.

test RTX 5080 (NVIDIA 615.78.08) Radeon 610M (RADV) lavapipe
agc_commands pass pass pass
agc_driver_flip pass pass pass
agc_driver_flip_stores_small_results pass pass pass
agc_driver_flip_compute pass pass pass

Windows (WinLibs GCC 15.2 UCRT, no GPU): the whole suite builds and runs; the one failure is one main has there too.

Death Stranding 2 on Linux, RTX 5080: with both commits the run passes 1333 s with no refused submission, stays on the loading screen and stops at 1630 s on a heap corruption abort (corrupted size vs. prev_size) that is not in this code. The title does not reach this call on plain main: it also needs the open PRs #6437, #6297, #6277, #6196, #6530, #6300, #6727, #6492 and #6174 (none of them touches this code) and local changes for EQAA targets and image-table residency that are not ready to submit.

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 under Silent stubs in their library's technical debt file
  • 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
  • Unblocks: PPSA02015
  • GPUs tested: RTX 5080 (NVIDIA 615.78.08), Radeon 610M (RADV, Mesa), lavapipe; Arch Linux
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Progress report (6a32550 → 66cc672)

📈 System libraries: 89.46% (+0.02%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceAgc sceAgcAcbSetFlip

@MarcZX10

Copy link
Copy Markdown
Contributor

The conventions failure is only the PR-template Depends on field: the validator requires Depends on: #N or Depends on: none directly on the checklist line. This PR lists integration-only prerequisites in prose, so please keep the checklist line in the accepted form (likely Depends on: none, since you state there is no code dependency) and move the runtime/integration context to the description above. The failed run reported this as its sole finding; eligibility, intake and progress report pass.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

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
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5115 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5431 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6501 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6549 core/libs/prx/libSceAgcDriver/Execution/src/Pm4.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6946 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cpp

@github-actions github-actions Bot added the agc libSceAgc* label Oct 16, 2026
@fma-rc

fma-rc commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

Thanks, fixed: the checklist line is now Depends on: none and the prerequisites are listed in the description. The conventions check passes on the edit.

@fma-rc
fma-rc force-pushed the feat/agc-acb-set-flip branch from 1eb6373 to 66cc672 Compare October 17, 2026 06:29
@fma-rc fma-rc changed the title feat(libSceAgc): implement sceAgcAcbSetFlip feat(libSceAgc): implement sceAgcAcbSetFlip and execute flips on compute queues Oct 17, 2026
@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 18, 2026
@adriadam10 adriadam10 self-assigned this Oct 19, 2026
@adriadam10
adriadam10 merged commit 9b34cba into boykopovar:main Oct 19, 2026
9 of 10 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the ACB flip packet against sceAgcDcbSetFlip, the compute-queue flip path (no flip hold on non-zero queues, own frame timing, EOP raised on the submitting queue) and the new agc_commands / agc_driver_flip cases, which fail on main with the errors quoted in the description; merged.

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

Labels

agc libSceAgc* unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants