Repository navigation
feat(agc): implement sceAgcGetPacketSize - #772
Merged
oneandonlydean merged 1 commit intoOct 5, 2026
Merged
Conversation
Co-Authored-By: Claude <noreply@anthropic.com>
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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)