WIP: perf(agc): read watched draw inputs from snapshots, not host imports #5900
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5900"
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 bcortezf on 2026-10-14T15:07:56Z.
What
Closes #5895 .
Since #2253,
InPlaceDrawInputhas bound vertex and index ranges in place from theirVK_EXT_external_memory_hostimport. The GPU reads imported memory far more slowly than memory the driver allocates, so draws that read their inputs this way spend most of their GPU time waiting.In Red Dead Redemption (PPSA30528) gameplay, ~900 G-buffer draws per frame, each with ~570 primitives, take ~230 µs each in place and ~2 µs each from a copy. Nsight GPU Trace shows the SMs ~96% idle during them, waiting on the reads.
Which path a range now takes:
CopyDrawInput), from a snapshot reused until a write lands on itDrawInputBudgetTests: the in-place tests now run on an unwatched host import. A watched range must come from a snapshot unless a GPU write over it is pending.
Tested
Windows 11 (10.0.26200), NVIDIA GeForce RTX 4070 SUPER, driver 616.64
agc_driver_recorder_tests --draw-inputs-in-place-onlypasses onmainand on this branch. On this machine imports are compared, not watched, so the watched assertions are skipped here; the unwatched in-place ones run. The fullagc_driver_recorder_testsrun stops at(9) a scan under a pending write was kept(DCC keys), and it stops there onmaintoo.mainwithout two local changes that no longer merge on it: thesceAudioOutGetSystemStateexport and RDR shader/state fixes. The A/B therefore usesmainata0f5916a2plus those local changes (base), against the same tree plus this commit (fix).InPlaceDrawInputis identical there and on currentmain.APS5_TRACE_SECONDS=84:5is set, plus the pad input file the runner uses to skip the intro. One warm-up run per side, then 3 interleaved runs per side.Results
Related: #5345, #5692, #3338 (inputs above
DrawInputBudgetstay in place).Summary lines and traces: attached (
aps5-summary.jsonlandaps5-trace-*.json.gzof the 6 runs).Earlier per-draw measurement, on the same machine with the stack of #494/#1193/#1202/#5216 on top of the same base, via draw timestamps:
Images are correct in both scenes.
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 github-actions[bot] on 2026-10-14T15:27:52Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppL929-931core/libs/prx/libSceAgcDriver/tests/Recorder.cppPull request closed