perf(agc): stage read and written buffer elements a dispatch sweeps #2681
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2681"
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 oneandonlydean on 2026-10-10T10:50:19Z.
What
A written V# element bound in place in a host import makes every load a PCIe round trip. In one title's particle update, a kernel loads and stores a 10 MiB pool (2048x64 threads over 131072 records of 80 bytes). That is above the 2 MiB written window, so it stayed in place and took about 4.8 ms of GPU per frame.
Two commits:
feat(shader):DescriptorBindinggainsbufferReadnext tobufferWrittenandbufferAtomic, filled from the resource tracker's existing per-bufferreadflag. It is kept in the shader disk cache, which bumps the format to 24. No key or ABI change.perf(agc): an element is now staged in device-local memory up to 16 MiB when all of these hold:The coverage test keeps a kernel that updates about 12k records of a 16 MiB pool in place: staging all of it would cost about 1.3 ms of copies for a 0.08 ms kernel. Write-only elements, indirect dispatches and raw (stride 0) buffers keep the 2 MiB window.
Tested
BUILD_TESTING=ON:ctest -R "agc|shader"passes 320/321. The one failure,agc_driver_dcc_keys_first_write, fails the same way on currentmain.agc_shader_disk_cache_tests:bufferReadsurvives the disk cache round trip and the binding plan.agc_driver_recorder_tests, newreadWrittenStagingTests, run on its own on the RTX 4090 (the full binary stops earlier onmainwith a 60 s lease wait, unrelated):0x500779a00went from about 4.8 ms of GPU per frame to 0.06 ms plus about 0.9 ms of copies.Checklist
main; no other open PR implements the same functionsNotImplemented_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 github-actions[bot] on 2026-10-10T10:54:15Z.
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/tests/ShaderDiskCache.cppL44core/shader/recompiler/ShaderDiskCache.cppL68-70core/shader/recompiler/ShaderDiskCache.hppL15core/libs/prx/libSceAgcDriver/tests/ShaderDiskCache.cppL44core/shader/recompiler/ShaderDiskCache.cppL68-70core/shader/recompiler/ShaderDiskCache.hppL15core/shader/recompiler/ShaderDiskCache.hppL15