fix(libSceAgcDriver): step over the one-dword NOP pad ffff1000 #1862
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1862"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by aashishaxo on 2026-10-08T22:19:54Z.
What
Step 1 of #1581.
0xffff1000is a type-3 NOP with count 0x3fff, which the command processor reads as one dword.sceAgcDcbResetQueuewrites it at the start of every call (measured on a PS5 in #1581), and the driver read it as a 16385-dword packet ("invalid PM4 packet size").Pm4::FillerPacketnow also matches exactly0xffff1000, so every walker (validation, submission, COND_EXEC ranges, execution) steps over it as one dword. The match is on the whole header, as in Mesa:src/amd/common/ac_parse_ib.cchecksheader == PKT3_NOP_PAD, andsid.hdefinesPKT3_NOP_PADasPKT3(PKT3_NOP, 0x3fff, 0). A NOP with count 0x3fff and other header bits set is still sized by its count.d4f7ddaaused the wider0x3fffff00mask for range predication; this PR keeps the exact header from Mesa.Refs #1581
Tested
Fork CI on c975fe54, before rebasing onto current main (84703ca7, same diff) (Linux and Windows build + ctest, relinker on Ubuntu, Windows and macOS): https://github.com/aashishaxo/AnyPS5/actions/runs/37848985909
testNopPad: Validate accepts the pad on graphics and compute queues and rejects it with a trailing dword; NOPs with count 0x3fff and header flags, and the largest counted NOP, are still sized by their count.testNopPadSubmission: the measuredop = 0envelope from #1581 submits and the packets after it run; a COND_EXEC range containing the pad counts it as one dword.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-09T15:23:09Z.
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
84703ca7, merged ontomaind70b8998in one build with 33 other AGC/shader PRs that had no Windows run.agc_driver_pm4,agc_driver_pm4_failure. None of them reported skipping a case.PATHsetup.No title was run.
🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T03:19:04Z.
This conflicts with main after today's merges; could you rebase? It passed testing and is otherwise ready.
Imported from boykopovar/AnyPS5. Originally posted by aashishaxo on 2026-10-10T05:56:40Z.
Rebased onto main. The conflict was the test registration in tests/Pm4.cpp main(); both tests are kept. Build and Progress report are waiting for workflow approval.
Imported from boykopovar/AnyPS5. Originally posted by aashishaxo on 2026-10-10T06:08:53Z.
Heads-up: #1629 is merged, so
sceAgcDcbResetQueueon main now starts every sequence withffff1000(DcbFlow/src/Control.cpp:82). The driver on main still sizes that header as a type-3 packet (Pm4::PacketWordsgives 16385 dwords), and this PR is what makes it step over the pad as one dword. It merges cleanly onto current main; Build and Progress report are waiting for workflow approval.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T07:18:37Z.
Rebase checked: same diff as before.
agc_driver_pm4andagc_driver_pm4_failurepass on the rebased head merged onto current main (scoped to libSceAgcDriver, 304 tests green); the newagc_driver_pm4test fails without thePm4.hppchange. Merging.