feat(agc): implement sceAgcGetPacketSize #772
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/772"
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 adriadam10 on 2026-10-05T22:51:00Z.
What
Implements
sceAgcGetPacketSize(was a throwing stub): returns the size in dwords of the PM4 packet atpacket.count + 2(bits 16-29), as KytyPS5AgcGetPacketSize(src/libs/agc.cpp).(header & 0x3fffff00) == 0x3fff1000, i.e.0xffff10xx): 1. Same mask as KytyPS5; matches Mesa'sPKT3_NOP_PAD(PKT3(PKT3_NOP, 0x3fff, 0), "header-only version",src/amd/common/sid.h, padded by radv/radeonsi).0x3fff10xx1), while PM4 makes a type-2 filler 1 dword, so the references disagree and the call throws instead of guessing. Same check assceAgcDcbGetSystemSoftwareVersionnext to it.CheckAddress), like the other functions inPacketInfo.cpp.No other reference has a body (shadPS4 and fpPS4: name only; SharpProspero: signature only).
New test
agc_packet_info_tests(tests/PacketInfo.cpp, in ctest). It isn't added toagc_command_testsbecause that target isn't registered in ctest and already fails onmain("expected an exception").Tested
Linux, GCC Release:
agc_packet_info_testspasses. It checks real headers (SET_SH_REG count 4 → 6, NOP count 0 → 2, count0x3ffe→0x4000, non-NOP count0x3fff→0x4001,0xffff1000/0xffff1001/0xffff10fc→ 1), that the packet is left unmodified, and the rejections (types 0/1/2, null, misaligned). Fails onmain(the stub throws). I also broke each piece on purpose (pad value,+2, NOP mask, type check, address check) and each change made the test fail. All the otheragc_*tests pass, apart fromagc_driver_pixel_helper_lanes/pixel_lds/pixel_lds_lane_slots, which also fail onmainon local RADV (wave32 on a 64-lane subgroup).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 github-actions[bot] on 2026-10-05T23:04:42Z.
Progress report (
bc24783→40c1910)📈 System libraries: 79.57% (+0.03%, +1 implemented functions)
✅ 1 implemented
sceAgcGetPacketSize