perf(agc): read DCC keys from the pending GPU fills that cover them instead of waiting for the fills #5520
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5520"
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 Nesyth on 2026-10-13T22:15:35Z.
What
A DCC key read that finds recorded GPU writes over the keys waits for the GPU unless the key-store memo holds one entry covering all of them. Keys filled in parts, a fill over part of the keys whose other part already holds the same byte, fills the fill HLE did not take as key fills, and keys under a unit shadow all wait, although the recorded fills already say what the keys will be. This change answers those reads from the recorded writes. In Ready or Not on
mainthe GPU waits for DCC keys drop from 16.9 to 8.5 ms per frame, but the FPS doesn't move, because a buffer copy that #5372 fixes takes most of each frame there. On my Ready or Not bring-up build, an older base with other local changes, the slow color-target lookups went from 28.7 to 3.9 ms per frame over three steps, two of them this change's commits (table below).main. Writes are ordered by when they were recorded, as the memo already assumes.Tested
Windows 11 Pro 10.0.22631, Ryzen 7 7800X3D, RX 7900 XTX, WinLibs GCC 15.2.0, Release, on
main0aa4cb1c2.pendingKeyStoreTestsgets its own ctest,agc_pending_key_stores, with new cases for fills over both halves of the keys, a later writer of unknown bytes, a fill over half of uncompressed keys, and keys that run past the end of committed memory.agc_driver_dcc_keys_first_writenow expects no wait where real GPU fills settle a storage image's keys, still expects one where a kernel's store is the newest writer, and checks the landed key bytes after each read.shadowedKeyStoreTestsintests/Recorder.cpp(ctestagc_shadowed_key_stores): keys under a fresh unit shadow are published and read after a wait, a fill over a stale unit shadow answers without a wait, and the stale slab is never published.ctest -R "^agc_": 482 of 485 pass and 2 skip.agc_driver_layered_volume_vertex_no_gplfails, as it does onmainon this GPU.main0aa4cb1c2, all libraries built from it and only the driver swapped, same scene, one run each, 30 s profiler windows. In this scenemaincopies a 768 KiB buffer on most draws (the case #5372 fixes), so a frame takes about 500 ms of queue-0 time and the FPS does not move:The frames match within the difference between two runs of the same build. With this change a texture whose pending fills leave mixed keys logs the existing "has mixed DCC keys ... read as stored" line;
mainreads it as stored too, without the line.Linux: not run.
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 MarcZX10 on 2026-10-13T22:20:32Z.
Review: APPROVED
Reviewed the newest-write range overlay and its fallback: later writes shadow earlier ranges, unknown stores fall back to synchronization when the pending values cannot be established, and inaccessible ranges do not get read speculatively. The added cases cover partial fills, mixed values, unknown writers and shadowed keys. The report provides Windows RX 7900 XTX test evidence; the current automated eligibility, conventions, intake and report checks pass, while Linux/full-build jobs are skipped and Linux was not run. I found no code-level blocker based on the submitted evidence.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T10:48:21Z.
Rebased onto current
main(conflict intests/Recorder.cpp: the two--*-onlyblocks inmain()were kept, no logic changes). Checked on the rebased tree: libSceAgcDriver build + ctest green (agc_driver_tessellationsegfaults onmaintoo);agc_pending_key_stores,agc_shadowed_key_storesandagc_driver_dcc_keys_first_writefail withDccMetadata.cppreverted. Merging once the Windows build is green.