feat(libSceAgcDriver): write the user data packets as firmware 13.42 does #13474
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13474"
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 BunnyFl on 2026-10-30T16:30:43Z.
What
sceAgcDriverUserDataWritePacket,sceAgcDriverUserDataWritePushMarker,sceAgcDriverUserDataWriteSetMarkerandsceAgcDriverUserDataWritePopMarkerwere parameterless stubs incore/libs/prx/libSceAgcDriver/Export.cppthat throw. In firmware 13.42's libSceAgcDriver.sprx (read from disassembly, not measured on a console), each one writes thread-trace user data packets into the caller's command buffer and returns how many dwords it wrote:WritePacketthe value is the caller's.sceAgcDriverUserDataGetPacketSizealready returns.sceAgcAcb*marker calls and 0 fromsceAgcDcbPopMarker, so it is namedasyncCompute. When it is 0, header bit 2 is set in both packets.The four functions now live next to
sceAgcDriverUserDataGetPacketSizeinSubmit/src/Dcb.cpp. Like the other writers there, they check the command buffer and the data range before writing. Their stubs are removed fromExport.cpp, and the four names leave the debt entry that lists throwing stubs there.The PM4 validator accepted header bit 2 (reset filter CAM) only on register-write opcodes. The draw-queue packets put it on a WRITE_DATA whose destination is a register, so validation stopped them. Such a WRITE_DATA now counts as a register write for that check. A WRITE_DATA to memory with bit 2 is still rejected.
A libSceAgcDriver debt entry records the source of the layout and the names that are not known.
Tested
Windows 11, WinLibs GCC 15.2, Release. No title was run.
agc_driver_pm4gainstestUserDataWriters: the exact dwords of the pop marker on both queue kinds, ofWritePacketon the compute queue (asyncCompute1) without data, with a null data pointer, with two bytes and with a 9-byte payload, of a push marker on the draw queue (0) and of a set marker on the compute queue (1); the word after the packet is left untouched. Each packet then goes throughValidateandExecute;mainexecutes a SET_UCONFIG_REG of 0x342 as a tag marker that writes no register state, so the test checks the 0x343 value only where a separate WRITE_DATA sets it. A WRITE_DATA to memory with header bit 2 is still rejected.main9304896d89), the 16agc_driver_pm4*tests pass 3/3. With the four writers made to throw asmain's stubs do,agc_driver_pm4fails 3/3. No other code or test in the repository calls them.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_REQUIRE_VULKAN=1andctest -V, onmainand on this branch, same machine and GPU: the 16agc_driver_pm4*tests pass on both, neither log reports the layer missing, and neither has aVUID-error. These tests create no Vulkan device, so the layer had nothing to check.asyncCompute0, 1, 2, 0x80000000 and random values, data sizes from 0 to 200 bytes, a null data pointer in about one call in ten, random values, names and colours): 0 mismatches in the returned count and every written dword. Nothing from the firmware is attached or added.check_conventions.py --base upstream/mainpasses.pr_overlap.py: my #13471 changes the same debt lines (the list of throwingExport.cppstubs), so whichever merges second needs a rebase; neither implements the other's functions. The 54 PRs it could not compare (they conflict withmain) share files, but none of their diffs names these four.progress.py --compare: +4 implemented functions in libSceAgcDriver, none flagged empty.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)mainand this branch, but they create no Vulkan device, so they exercise no GPU work (agc_driver_pm4*)🤖 Generated with Claude Code