fix(agc): read comp-to-single DCC keys of sampled textures and storage images #4700

Merged
Nesyth merged 3 commits from upstream-pr/4700 into main 2026-10-13 04:54:09 +00:00
Nesyth commented 2026-10-12 19:13:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Nesyth on 2026-10-12T19:13:43Z.


What

DCC key 0x10 (comp-to-single, GFX9_DCC_CLEAR_SINGLE in Mesa) marks a 256-byte block whose texels all equal its first texel. #2939 (b89b7f953) expands such keys in a CB DCC decompress pass. Sampled textures and storage images still read them as stored ([gpu] texture ... has single DCC keys ...; its texels are read as stored), so every texel but the first of each block came from whatever memory held before.

  • TextureClearKeys answers ClearSingle for uniform 0x10 keys when the format's element size divides 256 bytes. Other formats, and 0x10 mixed with other keys, still read as stored.
  • ReadTextureSurface reads the stored bytes and copies each block's first element over the rest of the block (ExpandSingleBlocks).
  • A storage image uploaded under single keys is handled like one under a clear code. Images uploaded under any other keys behave as before.
    • Its first write stores the keys uncompressed (MarkDirty).
    • A refresh that then finds them uncompressed keeps the units the image wrote (keyFlip and the stored rule in StorageTexture::Refresh).
  • cachedTexture changes in two ways under single keys:
    • It takes a snapshot instead of viewing a storage image that has results pending, because the image holds the unexpanded texels. An image uploaded under single keys stores the keys uncompressed at its first write, so this is about single keys stored after the upload, for example by the CPU after a kernel wrote the surface. In memory that stays write-watched while the image is pending (see RunSingleKeysOverPendingImage below), when only the keys were written, the lookup can find the surface unchanged and skip the image's refresh; without this line it then views the image and samples its own texels.
    • It reuses a cached snapshot only while guest memory is unchanged since the snapshot was made, the same check it applies under uncompressed keys. In memory that is not write-watched, that check compares guest memory with the expanded snapshot; the two differ unless every block already holds one value, so each lookup takes a new snapshot. main reads such keys as stored, so there an unchanged surface matches its snapshot and the snapshot is reused.
  • fastTexture applies that memory check under single keys too. main reads 0x10 keys as uncompressed, so it checks them today. Without this line, the new ClearSingle answer would skip the check, and a re-clear that kept the 0x10 keys but changed the first texels would reuse the old snapshot.
  • Draws into a color target over single keys are unchanged: they render over the stored texels. The comp-to-single entry in docs/dev/debt/libSceAgcDriver.md now describes the reads above and says so.
  • Tests:
    • singleDccKeysTests (TextureFormat):
      • for formats 1, 56 and 77: single keys read as ClearSingle, and a read gives every block its first element;
      • for format 74 (element does not divide 256 bytes): single keys read as stored;
      • single keys mixed with 0xff: read as stored.
    • DccKeysFirstWrite:
      • a pending comp-to-single key fill reads as single;
      • RunSingleKeys: a storage image's first write stores the keys uncompressed, and the write-back gives every texel the kernel did not write its block's first texel;
      • RunSingleKeysSampled: samples texel (1, 0) of a single-key texture (it must be its block's first texel), then samples again after the CPU changed that first texel under the same keys (it must be the new value). It runs from unwatched and from write-watched memory. Its output buffer is a separate allocation, and the write-watched run requires the texels to stay write-watched after the first sampling;
      • RunSingleKeysOverPendingImage: a kernel writes the first 32 texels of row 1 under uncompressed keys, so a storage image has results pending; the CPU then stores 0x10 keys, and texel (1, 0) must sample as its block's first texel, not as the image's unexpanded texel. It runs in write-watched memory whose host import keeps the watch: a shared mapping on Windows; on Linux the test sets the import watch to Watch for this case and restores it after (on lavapipe, imported ranges are otherwise compared).
    • With any one of the three ShaderResources.cpp lines above reverted, agc_driver_dcc_keys_first_write fails, on Linux and on Windows (see Tested).

Overlaps with open PRs; whichever merges second rebases:

  • #4554 edits textureClearKeys around the line this one changes, and adds its test next to these in tests/execution/DccKeysFirstWrite.cpp, where both declare std::optional<GuestBlock> sampled in main().
  • #4315 adds its tests next to singleDccKeysTests in tests/TextureFormat.cpp.

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 d53960612:

  • ctest: no failures out of 995 with 2fb6dccd7, and again with 83959f315, including agc_driver_graphics (singleDccKeysTests) and agc_driver_dcc_keys_first_write. With c809601df, agc_driver_dcc_keys_first_write passes; the full suite was not run again.
  • With 2fb6dccd7 and DccMetadata.cpp, ShaderResources.cpp and Texture.cpp as on main, both fail: agc_driver_graphics with "comp-to-single keys of format 1 must read as single", and agc_driver_dcc_keys_first_write with "a pending comp-to-single fill of the keys: the keys read uncompressed (expected single) and the read did not wait".
  • With c809601df and one of the three ShaderResources.cpp lines reverted at a time, agc_driver_dcc_keys_first_write fails with the same messages as on Linux below.
  • tools/check_conventions.py --base d53960612 passes on this head.

Linux, in my fork's Actions: ubuntu-24.04, GCC 13.3.0, lavapipe (Mesa 25.2.8), Release, ANYPS5_REQUIRE_VULKAN=1, with the upstream linux job's packages and configure options (without ccache); main d53960612 with this head (c809601df) merged in; only agc_driver_dcc_keys_first_write was built and run: https://github.com/Nesyth/AnyPS5/actions/runs/38320553715

  • It passes.
  • With one ShaderResources.cpp line reverted at a time, it fails:
    • without the fastTexture check: "comp-to-single keys sampled after the first texel of the block changed from write-watched memory: component 0 of thread 0 is 0x3f800000, expected 0x00000000";
    • without the snapshot reuse check in cachedTexture: "comp-to-single keys sampled after the first texel of the block changed from unwatched memory: component 0 of thread 0 is 0x3f800000, expected 0x00000000";
    • without the source reset in cachedTexture: "comp-to-single keys stored over a pending storage image: component 0 of thread 0 is 0x00000000, expected 0x3f800000".

Vampire Survivors (PPSA21703) on main 42496c5e5 without this change, plus only a local close() guard the title needs (#3295 is open for the same problem; see #3745):

  • After a 5-item chest, a blocky white and yellow overlay with a dot grid covers the screen and stays after the chest screen closes.
  • The log has two [gpu] texture ... (format 56) has single DCC keys ...; its texels are read as stored reports.

Vampire Survivors with this change, in an earlier session on main ffa198407 plus three local changes that are not pull requests (vertex input copies, AudioOut pacing and the close() guard), about 54 minutes of play:

  • No overlay after a 5-item chest.
  • No draw went into a color target whose keys were all 0x10, so the overlay needs only the sampled and storage reads changed here.
  • The log has no has single DCC keys or has mixed DCC keys reports.
  • The source and test changes there are the same as in 2fb6dccd7; the base differs.
  • Ready or Not (PPSA18605): without the change there were 1 to 6 has single DCC keys ...; its texels are read as stored reports per run, in five runs; with it there were none, in any run. No visible change in the scenes checked.
  • That Ready or Not result came from an earlier version of this change, which also expanded single keys before draws into a color target, applied the storage image rules above to images uploaded under any keys other than uncompressed, and did not have the fastTexture line. The build was an earlier state of the bring-up build: main bab7b3285 plus #4021, #4057, #1077, #425, #454, #4031, #2254 and local changes.

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: PPSA21703 #3745
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4833917544 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4700). Originally posted by [Nesyth](https://github.com/Nesyth) on 2026-10-12T19:13:43Z. --- ### What DCC key 0x10 (comp-to-single, `GFX9_DCC_CLEAR_SINGLE` in Mesa) marks a 256-byte block whose texels all equal its first texel. #2939 (b89b7f953) expands such keys in a CB DCC decompress pass. Sampled textures and storage images still read them as stored (`[gpu] texture ... has single DCC keys ...; its texels are read as stored`), so every texel but the first of each block came from whatever memory held before. - `TextureClearKeys` answers `ClearSingle` for uniform 0x10 keys when the format's element size divides 256 bytes. Other formats, and 0x10 mixed with other keys, still read as stored. - `ReadTextureSurface` reads the stored bytes and copies each block's first element over the rest of the block (`ExpandSingleBlocks`). - A storage image uploaded under single keys is handled like one under a clear code. Images uploaded under any other keys behave as before. - Its first write stores the keys uncompressed (`MarkDirty`). - A refresh that then finds them uncompressed keeps the units the image wrote (`keyFlip` and the `stored` rule in `StorageTexture::Refresh`). - `cachedTexture` changes in two ways under single keys: - It takes a snapshot instead of viewing a storage image that has results pending, because the image holds the unexpanded texels. An image uploaded under single keys stores the keys uncompressed at its first write, so this is about single keys stored after the upload, for example by the CPU after a kernel wrote the surface. In memory that stays write-watched while the image is pending (see `RunSingleKeysOverPendingImage` below), when only the keys were written, the lookup can find the surface unchanged and skip the image's refresh; without this line it then views the image and samples its own texels. - It reuses a cached snapshot only while guest memory is unchanged since the snapshot was made, the same check it applies under uncompressed keys. In memory that is not write-watched, that check compares guest memory with the expanded snapshot; the two differ unless every block already holds one value, so each lookup takes a new snapshot. `main` reads such keys as stored, so there an unchanged surface matches its snapshot and the snapshot is reused. - `fastTexture` applies that memory check under single keys too. `main` reads 0x10 keys as uncompressed, so it checks them today. Without this line, the new `ClearSingle` answer would skip the check, and a re-clear that kept the 0x10 keys but changed the first texels would reuse the old snapshot. - Draws into a color target over single keys are unchanged: they render over the stored texels. The comp-to-single entry in `docs/dev/debt/libSceAgcDriver.md` now describes the reads above and says so. - Tests: - `singleDccKeysTests` (TextureFormat): - for formats 1, 56 and 77: single keys read as `ClearSingle`, and a read gives every block its first element; - for format 74 (element does not divide 256 bytes): single keys read as stored; - single keys mixed with 0xff: read as stored. - `DccKeysFirstWrite`: - a pending comp-to-single key fill reads as single; - `RunSingleKeys`: a storage image's first write stores the keys uncompressed, and the write-back gives every texel the kernel did not write its block's first texel; - `RunSingleKeysSampled`: samples texel (1, 0) of a single-key texture (it must be its block's first texel), then samples again after the CPU changed that first texel under the same keys (it must be the new value). It runs from unwatched and from write-watched memory. Its output buffer is a separate allocation, and the write-watched run requires the texels to stay write-watched after the first sampling; - `RunSingleKeysOverPendingImage`: a kernel writes the first 32 texels of row 1 under uncompressed keys, so a storage image has results pending; the CPU then stores 0x10 keys, and texel (1, 0) must sample as its block's first texel, not as the image's unexpanded texel. It runs in write-watched memory whose host import keeps the watch: a shared mapping on Windows; on Linux the test sets the import watch to `Watch` for this case and restores it after (on lavapipe, imported ranges are otherwise compared). - With any one of the three `ShaderResources.cpp` lines above reverted, `agc_driver_dcc_keys_first_write` fails, on Linux and on Windows (see Tested). Overlaps with open PRs; whichever merges second rebases: - #4554 edits `textureClearKeys` around the line this one changes, and adds its test next to these in `tests/execution/DccKeysFirstWrite.cpp`, where both declare `std::optional<GuestBlock> sampled` in `main()`. - #4315 adds its tests next to `singleDccKeysTests` in `tests/TextureFormat.cpp`. ### 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` d53960612: - `ctest`: no failures out of 995 with 2fb6dccd7, and again with 83959f315, including `agc_driver_graphics` (`singleDccKeysTests`) and `agc_driver_dcc_keys_first_write`. With c809601df, `agc_driver_dcc_keys_first_write` passes; the full suite was not run again. - With 2fb6dccd7 and `DccMetadata.cpp`, `ShaderResources.cpp` and `Texture.cpp` as on `main`, both fail: `agc_driver_graphics` with "comp-to-single keys of format 1 must read as single", and `agc_driver_dcc_keys_first_write` with "a pending comp-to-single fill of the keys: the keys read uncompressed (expected single) and the read did not wait". - With c809601df and one of the three `ShaderResources.cpp` lines reverted at a time, `agc_driver_dcc_keys_first_write` fails with the same messages as on Linux below. - `tools/check_conventions.py --base d53960612` passes on this head. Linux, in my fork's Actions: ubuntu-24.04, GCC 13.3.0, lavapipe (Mesa 25.2.8), Release, `ANYPS5_REQUIRE_VULKAN=1`, with the upstream `linux` job's packages and configure options (without ccache); `main` d53960612 with this head (c809601df) merged in; only `agc_driver_dcc_keys_first_write` was built and run: https://github.com/Nesyth/AnyPS5/actions/runs/38320553715 - It passes. - With one `ShaderResources.cpp` line reverted at a time, it fails: - without the `fastTexture` check: "comp-to-single keys sampled after the first texel of the block changed from write-watched memory: component 0 of thread 0 is 0x3f800000, expected 0x00000000"; - without the snapshot reuse check in `cachedTexture`: "comp-to-single keys sampled after the first texel of the block changed from unwatched memory: component 0 of thread 0 is 0x3f800000, expected 0x00000000"; - without the source reset in `cachedTexture`: "comp-to-single keys stored over a pending storage image: component 0 of thread 0 is 0x00000000, expected 0x3f800000". Vampire Survivors (PPSA21703) on `main` 42496c5e5 without this change, plus only a local `close()` guard the title needs (#3295 is open for the same problem; see #3745): - After a 5-item chest, a blocky white and yellow overlay with a dot grid covers the screen and stays after the chest screen closes. - The log has two `[gpu] texture ... (format 56) has single DCC keys ...; its texels are read as stored` reports. <!-- screenshot: vs-chest-main-42496c5e5-without-4700.png --> Vampire Survivors with this change, in an earlier session on `main` ffa198407 plus three local changes that are not pull requests (vertex input copies, AudioOut pacing and the `close()` guard), about 54 minutes of play: - No overlay after a 5-item chest. - No draw went into a color target whose keys were all 0x10, so the overlay needs only the sampled and storage reads changed here. - The log has no `has single DCC keys` or `has mixed DCC keys` reports. - The source and test changes there are the same as in 2fb6dccd7; the base differs. - Ready or Not (PPSA18605): without the change there were 1 to 6 `has single DCC keys ...; its texels are read as stored` reports per run, in five runs; with it there were none, in any run. No visible change in the scenes checked. - That Ready or Not result came from an earlier version of this change, which also expanded single keys before draws into a color target, applied the storage image rules above to images uploaded under any keys other than uncompressed, and did not have the `fastTexture` line. The build was an earlier state of the bring-up build: `main` bab7b3285 plus #4021, #4057, #1077, #425, #454, #4031, #2254 and local changes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA21703 #3745 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-12 19:29:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T19:29:14Z.


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
#4315 core/libs/prx/libSceAgcDriver/tests/TextureFormat.cpp L98, L147
#4554 core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp L451-452
core/libs/prx/libSceAgcDriver/tests/execution/DccKeysFirstWrite.cpp L371, L512
#4878 core/libs/prx/libSceAgcDriver/tests/execution/DccKeysFirstWrite.cpp L503
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6131168103 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4700#issuecomment-6131168103). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T19:29:14Z. --- <!-- pr-overlap --> 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 | |---|---|---|---| | #4315 | `core/libs/prx/libSceAgcDriver/tests/TextureFormat.cpp` [L98](https://github.com/boykopovar/AnyPS5/blob/e15c316ead335690a6693b711a5c5e33cfda7652/core/libs/prx/libSceAgcDriver/tests/TextureFormat.cpp#L98), [L147](https://github.com/boykopovar/AnyPS5/blob/e15c316ead335690a6693b711a5c5e33cfda7652/core/libs/prx/libSceAgcDriver/tests/TextureFormat.cpp#L147) | | | | #4554 | `core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp` [L451-452](https://github.com/boykopovar/AnyPS5/blob/e15c316ead335690a6693b711a5c5e33cfda7652/core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp#L451-L452)<br>`core/libs/prx/libSceAgcDriver/tests/execution/DccKeysFirstWrite.cpp` [L371](https://github.com/boykopovar/AnyPS5/blob/e15c316ead335690a6693b711a5c5e33cfda7652/core/libs/prx/libSceAgcDriver/tests/execution/DccKeysFirstWrite.cpp#L371), [L512](https://github.com/boykopovar/AnyPS5/blob/e15c316ead335690a6693b711a5c5e33cfda7652/core/libs/prx/libSceAgcDriver/tests/execution/DccKeysFirstWrite.cpp#L512) | | | | #4878 | `core/libs/prx/libSceAgcDriver/tests/execution/DccKeysFirstWrite.cpp` [L503](https://github.com/boykopovar/AnyPS5/blob/e15c316ead335690a6693b711a5c5e33cfda7652/core/libs/prx/libSceAgcDriver/tests/execution/DccKeysFirstWrite.cpp#L503) | | |
MarcZX10 commented 2026-10-12 19:38:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-12T19:38:19Z.

Code review location: core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp; line 3237

@@ -3233,7 +3234,7 @@ std::shared_ptr<Texture> ShaderResources::fastTexture(const ImageRecord& record)
         // Under fast-clear keys the view holds only while its image's results are still pending over
         // the surface; flushed, the clear the image cannot see makes the lookup take a snapshot.
         if (keys != DccKeys::Uncompressed && StorageTexture::FindPending(address, record.guestBytes) != record.source) return nullptr;
-    } else if (keys == DccKeys::Uncompressed && !GuestMemory::UnchangedSince(address, bytes, record.entryGeneration)) {
+    } else if ((keys == DccKeys::Uncompressed || keys == DccKeys::ClearSingle) && !GuestMemory::UnchangedSince(address, bytes, record.entryGeneration)) {

The Windows run does not exercise this added branch because that path compares host imports rather than using write-watched memory, as the PR description notes. This check is what rejects a cached snapshot after guest memory changes while the ClearSingle keys remain unchanged. Could agc_driver_dcc_keys_first_write be run on Linux for this head and the result added? My local CMake configure could not reach the test: the PR worktree's SDL2 submodule is uninitialized, and the environment lacks the PipeWire/PulseAudio/ALSA development files required by the project configuration.

<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4251692024 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4700#discussion_r4251692024). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-12T19:38:19Z. **Code review location:** `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`; line 3237 ~~~~diff @@ -3233,7 +3234,7 @@ std::shared_ptr<Texture> ShaderResources::fastTexture(const ImageRecord& record) // Under fast-clear keys the view holds only while its image's results are still pending over // the surface; flushed, the clear the image cannot see makes the lookup take a snapshot. if (keys != DccKeys::Uncompressed && StorageTexture::FindPending(address, record.guestBytes) != record.source) return nullptr; - } else if (keys == DccKeys::Uncompressed && !GuestMemory::UnchangedSince(address, bytes, record.entryGeneration)) { + } else if ((keys == DccKeys::Uncompressed || keys == DccKeys::ClearSingle) && !GuestMemory::UnchangedSince(address, bytes, record.entryGeneration)) { ~~~~ --- The Windows run does not exercise this added branch because that path compares host imports rather than using write-watched memory, as the PR description notes. This check is what rejects a cached snapshot after guest memory changes while the `ClearSingle` keys remain unchanged. Could `agc_driver_dcc_keys_first_write` be run on Linux for this head and the result added? My local CMake configure could not reach the test: the PR worktree's SDL2 submodule is uninitialized, and the environment lacks the PipeWire/PulseAudio/ALSA development files required by the project configuration.
kr4y4 commented 2026-10-12 22:35:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kr4y4 on 2026-10-12T22:35:17Z.


The two runs the description lists as not done yet, on NVIDIA and Intel.

Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The rebased head 2fb6dccd7 merged into main 584cc4c57.

  • On the rebased head, agc_driver_graphics, agc_driver_dcc_keys_first_write and agc_driver_texture_format pass on both GPUs with --repeat until-fail:3. The full suite (ctest --timeout 120 --parallel 4) passes 1018 of 1018 on both.
  • With DccMetadata.cpp, ShaderResources.cpp and Texture.cpp as on main, the new tests fail on both GPUs:
    • agc_driver_graphics: comp-to-single keys of format 1 must read as single
    • agc_driver_dcc_keys_first_write: a pending comp-to-single fill of the keys: the keys read uncompressed (expected single) and the read did not wait

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6133914732 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4700#issuecomment-6133914732). Originally posted by [kr4y4](https://github.com/kr4y4) on 2026-10-12T22:35:17Z. --- The two runs the description lists as not done yet, on NVIDIA and Intel. Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The rebased head 2fb6dccd7 merged into `main` 584cc4c57. - On the rebased head, `agc_driver_graphics`, `agc_driver_dcc_keys_first_write` and `agc_driver_texture_format` pass on both GPUs with `--repeat until-fail:3`. The full suite (`ctest --timeout 120 --parallel 4`) passes 1018 of 1018 on both. - With `DccMetadata.cpp`, `ShaderResources.cpp` and `Texture.cpp` as on `main`, the new tests fail on both GPUs: - `agc_driver_graphics`: `comp-to-single keys of format 1 must read as single` - `agc_driver_dcc_keys_first_write`: `a pending comp-to-single fill of the keys: the keys read uncompressed (expected single) and the read did not wait` Written with AI assistance.
Nesyth commented 2026-10-13 00:32:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Nesyth on 2026-10-13T00:32:38Z.

Code review location: core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp; line 3237

@@ -3233,7 +3234,7 @@ std::shared_ptr<Texture> ShaderResources::fastTexture(const ImageRecord& record)
         // Under fast-clear keys the view holds only while its image's results are still pending over
         // the surface; flushed, the clear the image cannot see makes the lookup take a snapshot.
         if (keys != DccKeys::Uncompressed && StorageTexture::FindPending(address, record.guestBytes) != record.source) return nullptr;
-    } else if (keys == DccKeys::Uncompressed && !GuestMemory::UnchangedSince(address, bytes, record.entryGeneration)) {
+    } else if ((keys == DccKeys::Uncompressed || keys == DccKeys::ClearSingle) && !GuestMemory::UnchangedSince(address, bytes, record.entryGeneration)) {

Thanks. I ran it on Linux in my fork's Actions.

Two test commits are now on this branch:

  • 83959f315 moves the sampled output into a separate allocation, so the texels stay write-watched and the write-watched run depends on the fastTexture check, on Windows as well.
  • c809601df adds a case for the cachedTexture source reset, with a storage image whose results are still pending.

With them (ubuntu-24.04, GCC 13.3.0, lavapipe, Release, ANYPS5_REQUIRE_VULKAN=1, main d53960612 with this branch merged in), the test passes, and with any one of the three ShaderResources.cpp lines reverted it fails with its own message (the run's three negative-check steps): https://github.com/Nesyth/AnyPS5/actions/runs/38320553715

On Windows each of the three reverts fails with the same message as on Linux. The description now has the Linux result and the messages.

<!-- greyfinch-sync:boykopovar/AnyPS5:review-comment:4253556423 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4700#discussion_r4253556423). Originally posted by [Nesyth](https://github.com/Nesyth) on 2026-10-13T00:32:38Z. **Code review location:** `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp`; line 3237 ~~~~diff @@ -3233,7 +3234,7 @@ std::shared_ptr<Texture> ShaderResources::fastTexture(const ImageRecord& record) // Under fast-clear keys the view holds only while its image's results are still pending over // the surface; flushed, the clear the image cannot see makes the lookup take a snapshot. if (keys != DccKeys::Uncompressed && StorageTexture::FindPending(address, record.guestBytes) != record.source) return nullptr; - } else if (keys == DccKeys::Uncompressed && !GuestMemory::UnchangedSince(address, bytes, record.entryGeneration)) { + } else if ((keys == DccKeys::Uncompressed || keys == DccKeys::ClearSingle) && !GuestMemory::UnchangedSince(address, bytes, record.entryGeneration)) { ~~~~ --- Thanks. I ran it on Linux in my fork's Actions. Two test commits are now on this branch: - 83959f315 moves the sampled output into a separate allocation, so the texels stay write-watched and the write-watched run depends on the `fastTexture` check, on Windows as well. - c809601df adds a case for the `cachedTexture` source reset, with a storage image whose results are still pending. With them (ubuntu-24.04, GCC 13.3.0, lavapipe, Release, `ANYPS5_REQUIRE_VULKAN=1`, `main` d53960612 with this branch merged in), the test passes, and with any one of the three `ShaderResources.cpp` lines reverted it fails with its own message (the run's three negative-check steps): https://github.com/Nesyth/AnyPS5/actions/runs/38320553715 On Windows each of the three reverts fails with the same message as on Linux. The description now has the Linux result and the messages.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!4700
No description provided.