fix(agc): decode GFX10 single-component DCC clears in PPSA38500 loading #28192

Open
lgqdaxia wants to merge 1 commit from upstream-pr/28192 into main
lgqdaxia commented 2026-11-29 02:53:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by lgqdaxia on 2026-11-29T02:53:23Z.


What

A GFX10 single-component DCC surface can store that component as color or alpha. The fast-clear decoder always treated it as alpha, so an asymmetric 0001 or 1110 key could produce the opposite texel value when the descriptor assigns the component to color.

Read the decoded alpha-position flag for the GFX10 single-component case. The GCN and multichannel paths keep their existing behavior. The GFX10 branch in AMD PAL selects color or alpha in the same way. The related 1_5_5_5 PR #28118 currently rejects asymmetric one-channel clears. Combining the two would require its guard to allow the GFX10 case.

Tested

Windows 11, NVIDIA GeForce RTX 3080 Laptop GPU, driver 621.14.

  • agc_driver_dcc_key_presync samples a 1110-cleared R16 view on Vulkan. The main decoder fails the readback and the change passes it. The Khronos layer loaded on both sides and reported zero validation errors.
  • agc_graphics_profile_draw checks the clear bytes for both alpha positions on normalized, integer and floating-point layouts, and checks the existing GCN behavior. The main decoder fails the new single-component assertion and the change passes.
  • The Windows PPSA38500 integration passed the R32_UINT fast-clear stop and presented an outdoor frame. The integration later exited during a guest read.

The paired checks used main 4ea61d0de2 and candidate 59968aecef. The rebase onto 0f9cfb9319 preserved the decoder and both checks. The nearby scan-reporting change only affects where periodic statistics are written.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: PPSA38500
  • GPUs tested: NVIDIA GeForce RTX 3080 Laptop GPU, driver 621.14, Windows 11
  • AI-assisted: yes

Summary by CodeRabbit

  • Bug Fixes
    • Corrected clear-value handling for single-channel textures in certain layouts, improving consistency of displayed colors. Existing behavior for other layouts and guest-shader cases is preserved.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5546971144 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28192). Originally posted by [lgqdaxia](https://github.com/lgqdaxia) on 2026-11-29T02:53:23Z. --- ### What A GFX10 single-component DCC surface can store that component as color or alpha. The fast-clear decoder always treated it as alpha, so an asymmetric 0001 or 1110 key could produce the opposite texel value when the descriptor assigns the component to color. Read the decoded alpha-position flag for the GFX10 single-component case. The GCN and multichannel paths keep their existing behavior. The GFX10 branch in [AMD PAL](https://github.com/GPUOpen-Drivers/pal/blob/c5e800072a32f68b6ccc4422936d96167c6e0728/src/core/hw/gfxip/gfx9/gfx9MaskRam.cpp#L3998-L4038) selects color or alpha in the same way. The related 1_5_5_5 PR #28118 currently rejects asymmetric one-channel clears. Combining the two would require its guard to allow the GFX10 case. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11, NVIDIA GeForce RTX 3080 Laptop GPU, driver 621.14. - `agc_driver_dcc_key_presync` samples a 1110-cleared R16 view on Vulkan. The main decoder fails the readback and the change passes it. The Khronos layer loaded on both sides and reported zero validation errors. - `agc_graphics_profile_draw` checks the clear bytes for both alpha positions on normalized, integer and floating-point layouts, and checks the existing GCN behavior. The main decoder fails the new single-component assertion and the change passes. - The Windows PPSA38500 integration passed the R32_UINT fast-clear stop and presented an outdoor frame. The integration later exited during a guest read. The paired checks used main `4ea61d0de2` and candidate `59968aecef`. The rebase onto `0f9cfb9319` preserved the decoder and both checks. The nearby scan-reporting change only affects where periodic statistics are written. ### 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) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: none - [x] Unblocks: PPSA38500 - [x] GPUs tested: NVIDIA GeForce RTX 3080 Laptop GPU, driver 621.14, Windows 11 - [x] AI-assisted: yes <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Corrected clear-value handling for single-channel textures in certain layouts, improving consistency of displayed colors. Existing behavior for other layouts and guest-shader cases is preserved. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
MarcZX10 commented 2026-11-29 02:58:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T02:58:28Z.

Review: APPROVED


Reviewed — looks good

The change corrects GFX10 single component DCC clear decoding while retaining the existing GCN path; I found no verified blocking defect in the three changed files.

What I ran

Reviewed head 6f34827828113c4d136afa1aa2e42e3bb5688b27. Read the prepared description, commits, manifest, and diff, plus the changed decoder and test ranges through repo_read.py. Searched for FillDccClear callers and GCN profile usage. No test commands were run.

Results

Check Result Note
Diff and changed code review passed Three changed files read
Tests not run Author-reported checks are not independent runs

Findings

Blocking

None.

Non-blocking

None.

Not verified

Did not run the reported Windows Vulkan tests or PPSA38500 integration. Reviewed only relevant ranges in each changed file; the rest of those files was not read. No files were excluded according to the manifest.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6101158996 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28192#pullrequestreview-6101158996). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-29T02:58:28Z. **Review:** APPROVED --- # Reviewed — looks good The change corrects GFX10 single component DCC clear decoding while retaining the existing GCN path; I found no verified blocking defect in the three changed files. ## What I ran Reviewed head `6f34827828113c4d136afa1aa2e42e3bb5688b27`. Read the prepared description, commits, manifest, and diff, plus the changed decoder and test ranges through `repo_read.py`. Searched for `FillDccClear` callers and GCN profile usage. No test commands were run. ## Results | Check | Result | Note | |---|---|---| | Diff and changed code review | passed | Three changed files read | | Tests | not run | Author-reported checks are not independent runs | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified Did not run the reported Windows Vulkan tests or PPSA38500 integration. Reviewed only relevant ranges in each changed file; the rest of those files was not read. No files were excluded according to the manifest. ## To get this to a good state Nothing is required.
Plyxen commented 2026-12-03 06:04:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T06:04:21Z.

Review: APPROVED


I read the diff at 6f34827828. Windows 11, GCC 15.2, merged into main at cf556db18c3 together with other open PRs (so not an isolated build), with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 and VK_LAYER_KHRONOS_validation on an RTX 5080 (621.24) and a Radeon iGPU (26.11.2).

  • agc_driver_dcc_key_presync and the 60 tests of agc_driver_graphics_tests: pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has a VUID- or SYNC-HAZARD line.
  • Control (same tree and tests, the changed files of those PRs put back to main's): agc_driver_dcc_key_presync fails on both GPUs: "single-component color did not sample the 1110 fast-clear value".

Not checked: PPSA38500 itself.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6164485763 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28192#pullrequestreview-6164485763). Originally posted by [Plyxen](https://github.com/Plyxen) on 2026-12-03T06:04:21Z. **Review:** APPROVED --- I read the diff at `6f34827828`. Windows 11, GCC 15.2, merged into `main` at `cf556db18c3` together with other open PRs (so not an isolated build), with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1` and `VK_LAYER_KHRONOS_validation` on an RTX 5080 (621.24) and a Radeon iGPU (26.11.2). - `agc_driver_dcc_key_presync` and the 60 tests of `agc_driver_graphics_tests`: pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has a `VUID-` or `SYNC-HAZARD` line. - Control (same tree and tests, the changed files of those PRs put back to `main`'s): `agc_driver_dcc_key_presync` fails on both GPUs: "single-component color did not sample the 1110 fast-clear value". Not checked: PPSA38500 itself. AI-assisted: yes (Claude Code)
ligmaSec commented 2026-12-03 18:44:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T18:44:52Z.

Review: COMMENTED


The clear decoder now selects color for the single-component GFX10 layout when the descriptor's alpha-position bit is clear. The tests distinguish the asymmetric 0001 and 1110 keys, cover both positions across several formats, and explicitly exercise the GCN behavior. The Vulkan presync case checks that the decoded clear reaches the sampled texel.

The local merge of 6f34827828 was clean. Paired Linux lavapipe runs passed agc_driver_dcc_key_presync, agc_driver_gcn_scalar_buffer_base, and agc_graphics_profile_draw on both a9cbd48cb0 and the merge. Both verbose logs show Khronos validation 1.4.369 inserted with zero missing-layer or VUID- messages. The NVIDIA and title results come from the author's runs.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6176214956 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28192#pullrequestreview-6176214956). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T18:44:52Z. **Review:** COMMENTED --- The clear decoder now selects color for the single-component GFX10 layout when the descriptor's alpha-position bit is clear. The tests distinguish the asymmetric 0001 and 1110 keys, cover both positions across several formats, and explicitly exercise the GCN behavior. The Vulkan presync case checks that the decoded clear reaches the sampled texel. The local merge of `6f34827828` was clean. Paired Linux lavapipe runs passed `agc_driver_dcc_key_presync`, `agc_driver_gcn_scalar_buffer_base`, and `agc_graphics_profile_draw` on both `a9cbd48cb0` and the merge. Both verbose logs show Khronos validation 1.4.369 inserted with zero missing-layer or `VUID-` messages. The NVIDIA and title results come from the author's runs. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/28192:upstream-pr/28192'
git switch 'upstream-pr/28192'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/28192'
git switch 'upstream-pr/28192'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/28192'
git switch 'upstream-pr/28192'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/28192'
git switch 'main'
git merge --squash 'upstream-pr/28192'
git switch 'main'
git merge --ff-only 'upstream-pr/28192'
git switch 'main'
git merge 'upstream-pr/28192'
git push origin 'main'
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!28192
No description provided.