test(libSceAgc): check ten packet sizes against the packets their writers emit #16987
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16987"
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 milescoviello on 2026-11-08T04:11:07Z.
What
Ten AGC size functions had no test: the ones a game calls to reserve command buffer space before it writes the packet. Our relinked titles import them:
sceAgcDcbDrawIndexAutoGetSize,sceAgcDcbDrawIndexIndirectGetSize,sceAgcDcbDrawIndirectMultiGetSize,sceAgcDcbCondExecGetSize,sceAgcAcbCondExecGetSize,sceAgcAcbRewindGetSizesceAgcDcbSetIndexBufferGetSize,sceAgcDcbGetLodStatsGetSizesceAgcCbSetShRegisterRangeDirectGetSizesceAgcCbSetUcRegisterRangeDirectGetSizeA size that is smaller than the packet makes a game's own reservation too short, so each check writes the packet into an empty command buffer with the writer of the same name and compares the bytes it took with the size function's answer. The register range checks use three values.
sceAgcDcbSetBaseDrawIndirectArgsGetSize,sceAgcDcbSetBaseDispatchIndirectArgsGetSizeandsceAgcCbQueueEndOfPipeActionGetSizeare imported too, but no writer of the same name exists, so they are left out.Test only.
Tested
ctest -R '^(agc_commands|agc_initialization)$':78ac647a46: 2 of 2 in 3 of 3 runs.main13b19a1dca: 2 of 2.CondExecsize 16 instead of 20,agc_commandsfails with "graphics conditional execution size differs from its packet", so a size that is shorter than its packet is caught.78ac647a46and onmain13b19a1dca.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code