perf(agc): a DMA_DATA prefetch keeps the draw pipeline #6538
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6538"
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 TheAggie on 2026-10-15T19:24:00Z.
What
With pipelined draws, every packet that is not known to be safe drains the draw pipeline before it runs.
DMA_DATAwith its destination set to nowhere (DST_SEL 2) is a cache prefetch: it writes no memory, so there is nothing for the draws ahead of it to order against. RADV issues one per draw for its descriptor and push-constant rings (about 12,000 a second in a PS2 title under RetroArch's PCSX2 core, every one a drain), and each drain idles the queue worker until the committer catches up.keepsDrawPipelinekeeps the pipeline for aDMA_DATAwhose destination is nowhere. Copies, fills and GDS transfers drain as before.DrawPipeline::Drains(reason)reads a drain count under the pipeline's lock, for the test.Overlaps with #6208, which pipelines every
DMA_DATAand covers this case among others; that PR is being reworked, and this one is the one-line subset that needs no snapshotting, with its own test and numbers. If #6208 lands first this PR is void.Tested
Windows 11, NVIDIA GeForce RTX 5070 Ti, MinGW-w64 GCC 15.2.0, on main
92e50418f.ctest: 1276 of 1295 pass, 14 skipped.guest_call_trace_abortandwindows_backtrace_reportfail, and fail the same way on plain main here;agc_driver_prepared_graphics_prebuild_0/_1andundeliverable_host_exceptionfail under my test runner because it skips their environment changes and pass pattern, and pass run with those.agc_driver_pipelined_prefetch: a commit holds the draw pipeline busy, and aDMA_DATAis submitted with a label write behind it. For a prefetch the queue worker passes it and the label queues behind the held commit, with no packet drain; for a copy the worker is held in the copy's drain until the commit is released, one drain, and the copy's bytes land. Without the change the prefetch case fails the same way the copy case passes: the worker is held.[draw] pipelinedline's packet drains per 10 s from about 120,000 (all opcode 0x50) to under 1,000 (none 0x50). The lighter scenes reach real time.Checklist
main; no other open PR implements the same functions (#6208 overlaps, see above)NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T20:24:03Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppImported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-16T17:19:59Z.
Rebase handoff — rebased onto current
main(authorship unchanged). One conflict inDrawPipeline.cpp: two drain-metrics functions landed at the same spot —main'sDrainRequestsByOpcode(used by the pipelined dispatch tests) and this PR'sDrains(DrainReason)(used by the prefetch test); both kept.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesmainregression (agc_driver_tessellationsegfault, #4727), not this PRTo pick it up:
Head is
d7f2311bd.Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-17T12:05:16Z.
Re-anchored rebase handoff —
mainmoved since the earlier handoff, so the branch is rebased onto currentmainagain (authorship unchanged; the same two drain-metrics functions kept,main'sDrainRequestsByOpcodealongside yours).Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesmainregression (agc_driver_tessellationsegfault, #4727), not this PRTo pick it up:
Head is
7e55f5b93.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T05:51:30Z.
This pull request is labeled
perf, so it needs the summary line of a capture onmainand one with the change, from the same title, scene and machine, as the Performance report form asks. Please paste bothaps5-summary.jsonllines, attach the two traces and add the output oftools/trace_digest.py.