fix(agc): copy a shader, context or user config register to memory with COPY_DATA #5477
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5477"
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 LeandroLP23 on 2026-10-13T20:48:14Z.
What
PS5 FSR4 Showcase (PPSA99011) stops with
AGC driver: COPY_DATA at DWORD 69: COPY_DATA register, GDS or reference-clock source is not implementedonce #5163 gets it pastsceAgcInit. Right after aDISPATCH_DIRECTit copies three SH registers to memory with COPY_DATA (control0x00100200:SRC_SEL0, register;DST_SEL2, memory):0x2e0c:COMPUTE_PGM_LO0x2e07:COMPUTE_NUM_THREAD_X0x2e00:COMPUTE_DISPATCH_INITIATORChanges:
0x2c00, context registers at0xa000and user config registers at0xc000.COUNT_SELcopies two consecutive registers.ResolveStoreleaves such a copy toExecute: the value depends on the registers at the packet's place in the stream.COMPUTE_DISPATCH_INITIATOR, and the group counts of aDISPATCH_DIRECTintoCOMPUTE_DIM_X/Y/Z. After each dispatch,Pm4::NoteDispatchRegistersdoes the same in the queue's shader registers. It runs in both the worker and the dispatch-ahead pass.DISPATCH_INDIRECTclears the three counts, because they come from memory, so a later copy of them throws.0x207-0x213from the shader registers, so they are unchanged.Copies to a register, and GDS and reference-clock sources, are rejected as before.
Tested
Windows 11 (26300), AMD Radeon 860M (RDNA 3.5, driver 32.0.13058.8001), WinLibs GCC 15.2.0, Release, on
maina0f5916a2.agc_driver_pm4(extended) passes. It covers:ResolveStoredoes not resolve a register copy.tools/check_conventions.pypasses.--windows --trap-sdk-syscall-stubs), with this branch and #5163 merged locally, 3 runs of 60 s:FSR4_SHOWCASE_SUBMIT probe_ms=0.61and reachesFSR4_SHOWCASE_CHAPTER index=0 title=FSR 4 on PlayStation 5.MUBUF resource descriptor register range overflow, and 1 of 3 runs with its ownvkQueueSubmit(...) = -4.ctest -R '^agc_' -j 1on this machine, test shader cache emptied: 480 passed, 2 skipped, and 1 failed,agc_driver_layered_volume_vertex_no_gpl. That test fails onmainon this driver too: GPL-off pipelines on it, #4768.conventions_ci_gate, which fails on any fork.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)Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T23:47:41Z.
Windows test of #5477: Windows 10 (19045), MinGW-w64 GCC 15.2, Release,
ninja -j 4, ctest called directly. Tree:main7a0c838ca+ merge of5e36c08748c6cf464521faac41b24caddb4f6c32(local merge9fa5d9168), targetagc_driver_pm4_tests.agc_driver_pm4: exit code 0, 3 of 3 runs.agc_driver_pm4_failure: exit code 0, 3 of 3 runs.Not tested: that the new Pm4 test cases fail without the change (no baseline run), Linux, a title run (PPSA99011 not available here), AMD, other ctest targets. These tests select no GPU.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T20:13:07Z.
Rebased onto current
main(conflict inPm4.cppwith theCopyDataSource/CopyDataBytesrefactor; the register source now goes through those helpers) and added the missing technical-debt line indocs/dev/debt/libSceAgcDriver.mdfor COPY_DATA from a register and the dispatch registers it reads.Checked:
agc_driver_pm4and the libSceAgcDriver scope pass on the rebase (onlyagc_driver_tessellationsegfaults, as onmain); the new test no longer builds without the change;COMPUTE_DISPATCH_INITIATOR/COMPUTE_DIM_*(0x2e00-0x2e03) are outsideDrawKeyRegisters, so draw keys are unchanged. Merging once the full build is green.