fix(agc): accept WRITE_DATA destination 3 for memory fences #3539
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3539"
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 MarcZX10 on 2026-10-11T12:42:29Z.
What
Allow
WRITE_DATAwithDST_SEL 3to write to guest memory. Packet execution and label resolution already handle acceptedWRITE_DATAdestinations as memory; validation was the part rejecting destination 3 as GDS. The PM4 tests now cover a normal memory write, resolving a one-dword write as a label, and continued rejection of register destination 0.TechnicalDebt.mdrecords the reported evidence and that the console's internal routing remains unknown.This carries the fix commit from the issue reporter, Mouad, with the original authorship preserved.
Closes #3534.
Tested
Linux x86-64, GCC 12.2, Release:
agc_driver_pm4passed three consecutive CTest runs.python3 tools/check_conventions.py --base upstream/mainandgit diff --check upstream/main...HEADpassed.The issue reporter separately reports a Fedora/Intel Arc title run reaching Killzone: Liberation's controls screen and running for 120 seconds. I did not independently run that title or test on Windows/console hardware.
Checklist
main; no other open PR implements the same behaviorNotImplemented_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 MarcZX10 on 2026-10-11T12:52:57Z.
The current CI run has finished: conventions, eligibility/report, Ubuntu and Intel macOS register-context/write-watch, and all three relinker jobs pass. Full Linux/Windows builds are skipped by the contributor workflow. The local Release build and
agc_driver_pm4CTest passed 3/3 on this head.Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-11T13:20:36Z.
Hit the same packet from another title, in case it helps as evidence: Hot Shots Golf 2 (PPSA06699, PS1HD) calls
sceAgcDcbWriteDatawith destination 6, which the builder emits as DST_SEL 3 from the ME. It writes 0 to a label, a RELEASE_MEM then sets that label to 1, and a WAIT_REG_MEM_64 waits on it, so the 64-bit address is guest memory there too, not a GDS offset.KytyPS5 does the same:
src/graphics/guest_gpu/graphicsRun.cppL328-351 computesdst_sel = bit30 | ((ctrl >> 7) & 0x1e)and writes memory for 6 (7 is not accepted). It is the only reference that accepts it; shadPS4 (liverpool.cpp:731) and sharpemu (GpuCommandInterpreter.Memory.cs) reject DST_SEL 3.I had a branch with the same change, so I'm dropping it in favour of this one.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T21:36:54Z.
Checked: build + ctest of libSceAgcDriver green (
agc_driver_pm4included), and the new PM4 checks fail without thePm4.cppchange. DST_SEL 3 already executed and resolved as a label as memory; only validation rejected it, and the register destination is still rejected. The Killzone: Liberation and Hot Shots Golf 2 evidence, plus the independent Linux run, covers what we can't run here. Merging.