fix(agc): remake a surface's storage image when its DCC keys move #177
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/177"
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-09-30T11:47:29Z.
What
The storage image cache keys a surface by memory, extent, layout and storage format, and the image keeps the DCC key range of the first descriptor that made it. When a later descriptor names other metadata for the same surface (the title reallocated the keys, or the memory held another surface before), the cached image kept the old keys. The title's fast clears of the new keys never reached it, and its write-backs marked keys the surface no longer owns.
Now, when a descriptor with DCC metadata names a key address other than the cached image's,
cachedStorageTextureevicts that image and makes a new one from memory under the named keys.evictStorageflushes the old image's pending results first, as it does for any eviction, so the new image starts from what the rendering left in memory. Views and recipes that still hold the old image see it gone from the cache (StorageImageCached). A sampled view of another image's pending results (FindPending) is taken only when that image follows the same keys. A descriptor without metadata keeps whatever image the surface has.In PPSA21564 the title draws its intro movie into the 4K UI layer and, on the title screen, fast-clears that layer through its DCC keys before drawing PRESS ANY BUTTON. In runs where the layer's first descriptors at boot named other metadata, the clear was lost and the layer kept the movie's last, nearly black frame over the whole title scene until the menu: an intermittent black title screen.
The recorder test device now sets
formatProperties, which aStorageTextureneeds to pick its Vulkan format. #131 adds the same line; the two merge cleanly.Tested
agc_driver_recorder_testsgetsmovedMetadataTests. On a host-imported 256x256 surface it makes the storage image under uncompressed keys, then names a second key range holding a fast clear. It checks that the image is remade under the new keys and reads the clear, that the old image left the cache, that a descriptor without metadata keeps the new image, and that moving the keys back remakes the image from memory. On main it fails with "the storage image kept the keys the surface no longer names".evictStorage's existing flush, and whether the flush stores them depends on write tracking of the test block, which Linux main does not have yet (#121). A version of the test that draws into the image before moving the keys back passes with #121 merged.ctest: 64/64 pass.agc_driver_graphics_testspasses on a throwaway merge with #113 (which links it again).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 repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-09-30T16:13:11Z.
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/ShaderResources.cppL297