Skip to content

fix(agc): read the DCC keys of sampled textures after the GPU writes recorded before them - #4699

Closed
Nesyth wants to merge 1 commit into
boykopovar:mainfrom
Nesyth:fix/agc-dcc-keys-after-recorded-writes
Closed

Nesyth wants to merge 1 commit into
boykopovar:mainfrom
Nesyth:fix/agc-dcc-keys-after-recorded-writes

Conversation

@Nesyth

@Nesyth Nesyth commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

What

A sampled texture's DCC keys were read straight from guest memory. That read is textureClearKeys, which sits behind TextureClearKeys, ProvedClearKeys and the sampled path of cachedTexture. 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.

  • textureClearKeys now reads the keys through currentDccKeys, as render targets already do through CurrentDccKeys. Under the GPU lock, a key range with a recorded writer is answered in one of two ways:
    • if the driver made that store itself, from the pending store's keys (PendingStoreKeys);
    • otherwise, the read first waits for the writer (Recorder::SyncThrough).
  • Without the GPU lock, or with no recorded writer over the range, the keys are read as before.
  • A sampled texture over keys that recorded work writes can therefore now wait for that work under the GPU lock, where it used to read the memory at once.
  • Test: pendingKeyStoreTests records a vkCmdFillBuffer that writes 0001 clear keys (0x40) over a texture's key range, and notes it as a pending write. TextureClearKeys must then answer Clear0001 and leave no pending writer. On main it answers Clear0000 from the stale bytes ("a sampled texture read its DCC keys before the recorded GPU write over them landed").
  • pendingKeyStoreTests had no ctest entry, so it now runs alone as agc_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:

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, on main ffa1984. The branch was rebased onto main d539606 for this pull request and is not yet rebuilt or re-tested there:

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
#4017 core/libs/prx/libSceAgcDriver/CMakeLists.txt L899
#4554 core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp L451-452

@github-actions github-actions Bot added build agc libSceAgc* labels Oct 12, 2026
@Nesyth

Nesyth commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favour of #4554, see my comment there.

@Nesyth Nesyth closed this Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant