fix(agc): read the DCC keys of sampled textures after the GPU writes recorded before them #4699
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4699"
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-12T19:13:32Z.
What
A sampled texture's DCC keys were read straight from guest memory. That read is
textureClearKeys, which sits behindTextureClearKeys,ProvedClearKeysand the sampled path ofcachedTexture. Recorded work that has not run yet can still write those keys: a title's clear or decompress kernel, or a copy or fill over the key range. A texture sampled later in the same batch then decided its content (clear-code fill or "read as stored") from the keys as they were before that work.textureClearKeysnow reads the keys throughcurrentDccKeys, as render targets already do throughCurrentDccKeys. Under the GPU lock, a key range with a recorded writer is answered in one of two ways:PendingStoreKeys);Recorder::SyncThrough).pendingKeyStoreTestsrecords avkCmdFillBufferthat writes 0001 clear keys (0x40) over a texture's key range, and notes it as a pending write.TextureClearKeysmust then answerClear0001and leave no pending writer. Onmainit answersClear0000from the stale bytes ("a sampled texture read its DCC keys before the recorded GPU write over them landed").pendingKeyStoreTestshad no ctest entry, so it now runs alone asagc_pending_key_stores(--pending-key-stores-only), like the other recorder tests.Related: #1359 (open) makes direct consumers wait for copied writes whose CPU write-back has not happened yet, DCC metadata included. This PR covers keys that recorded GPU work writes in place, which #1359 does not wait for. The two change different functions.
Overlaps with my other open PR; whichever merges second rebases:
textureClearKeys.Tested
Windows 11 Pro 10.0.22631, AMD Ryzen 7 7800X3D, AMD Radeon RX 7900 XTX, WinLibs GCC 15.2.0, Release,
BUILD_TESTING=ON, onmainffa198407. The branch was rebased ontomaind53960612for this pull request and is not yet rebuilt or re-tested there:ctest: 952/952 passed:main's 951 (8 of them skip there too) plus the newagc_pending_key_stores.DccMetadata.cppas onmain,agc_pending_key_storesfails with the message above.tools/check_conventions.py --base origin/mainpasses.[gpu] texture ... has mixed DCC keys ...; its texels are read as storedreports went from 11 and 14 (two runs without this change) to 2 in each of three runs with it. The 6 reported before the level load are gone.mainbab7b3285plus #4021, #4057, #1077, #425, #454, #4031, #2254 and local changes, before #3864, #3865, #4012, #4248 and #1359 were added. It was not measured on this branch alone.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-12T19:29:12Z.
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.txtL899core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cppL451-452Imported from boykopovar/AnyPS5. Originally posted by Nesyth on 2026-10-12T21:03:51Z.
Closing in favour of #4554, see my comment there.
Pull request closed