perf(agc): keep a surface's storage image when another descriptor names uncompressed DCC keys #466
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/466"
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-03T14:33:02Z.
What
The storage cache keeps one image per surface, and the image follows the DCC key range of the descriptor that made it. When a descriptor names other keys,
MetadataMovedremakes the image: its pending results are stored, and it is destroyed, created and uploaded again under the new keys.PPSA21564's galaxy map renders a 1920x1080 surface as a color target whose CB names DCC keys at one address, then writes the same surface from a compute shader whose T# names keys at another. Both key ranges read uncompressed every frame, yet the image was remade twice a frame (1231 constructions in a 56 s scene), and the views and draw recipes built on it were thrown away each time.
A descriptor naming other keys now keeps the image when the move cannot be observed:
That is exactly the content an image made under the named keys would hold once this one's pending results were stored. Every other case (a fast clear of either key range, a register clear, an image holding a clear) still remakes the image as before, so clears of the new keys reach it and pending results are stored first.
KeysServeSurface(DccMetadata.hpp) is the rule;StorageTexture::ServesKeysAtapplies it with the image's key proofs, and keeps a few proofs for named key ranges so a repeated check does not rescan keys while the key bytes are unchanged.Tested
BUILD_TESTING=ONandctestpass (128/128);agc_driver_recorder_tests(GPU, run by hand) passes.agc_dcc_key_sharing(ctest, CPU only) drivesKeysServeSurfacethrough a model of the storage cache: the galaxy map's frame pattern (a color target and two compute descriptors naming two uncompressed key ranges) makes the image once in 100 frames, where the previous rule remakes it 199 times; a fast clear of the named keys, a clear of the followed keys, and a filled or cleared upload each still remake it; descriptors without metadata or naming the image's own keys never scan keys.KeysServeSurfaceis new, so the test does not build without this change.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 boykopovar on 2026-10-03T15:06:19Z.
Thanks for your active contributions. I’d like to give you merge access to the repository. Would you be interested? So many pull requests...
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-03T16:34:36Z.
I agree that should be more reviewers. every time i do a PR i think about the time you have to spend in every one of them :/
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-03T19:41:20Z.
Thank you, I'd be glad to help with reviews and merges. Here is how I'd plan to use it, so you can say if you'd like it different:
Also, #477 should stop the agc_driver_vopc_compare failures that keep hitting Linux CI, which will make reviews a bit easier.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-03T19:51:36Z.
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/CMakeLists.txtL249Imported from boykopovar/AnyPS5. Originally posted by boykopovar on 2026-10-03T21:23:23Z.
I've sent out an invitation to collaborators. Please avoid regressions on Dreaming Sarah. And of course, you can (and should) merge your PRs too, if you're confident and don't need advice. #477 was merged.