fix(agc): require full coverage only for metadata pass targets with CMASK or DCC keys #9694

Merged
Tamalero merged 1 commit from upstream-pr/9694 into main 2026-10-27 05:20:39 +00:00
Tamalero commented 2026-10-22 08:47:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-22T08:47:08Z.


What

With #8991, Marvel's Guardians of the Galaxy (PPSA01748) gets past its menus. After New Game and the first level load, it stops in presentation on:

AGC graphics: CB metadata pass over part of a color target

Cause: the pass is a fast-clear eliminate (CB_COLOR_CONTROL mode 2) over three 1920x1080 color targets that have no CMASK and no DCC keys. The viewport covers the targets (xs/xo = 960/960, ys/yo = 540/540), but PA_SC_MODE_CNTL_0 still enables the viewport scissor, and PA_SC_VPORT_SCISSOR_0 is left at 480x270 from an earlier pass. DecodeColorMetadataPass requires every target to be covered, so it refuses. For these targets the pass changes nothing: RunColorMetadataPass touches a target only through its CMASK clear or its DCC keys.

Fix: the coverage check applies only to targets with a CMASK or DCC keys. A partial pass over such a target is still refused as before, and FMASK decompress (which requires a CMASK) and resolves are unchanged.

Tested

Linux (CachyOS, kernel 7.2.9), GCC 16.2.1, Release, BUILD_TESTING=ON, RTX 4090 (NVIDIA 615.78.08).

  • metadataPassTests (agc_driver_graphics): the two partial-coverage cases (a scissor and a viewport that miss part of the target) now first check that a target without CMASK or DCC keys decodes with its target. Then they add DCC keys to the same state and require the refusal as before.
  • Negative check: with State.cpp restored to main, agc_driver_graphics fails on the new expectation. With the change, agc_driver_graphics and agc_driver_graphics_maps_fallback pass. ctest -R '^agc_' (866 tests): 862 pass and 1 skips. The three agc_driver_sample_order* tests fail ("2x scene with the standard locations: the slopes did not leave depth both at and below the clear value"), and they fail the same way on main d6eafa54d on this machine.
  • python3 tools/check_conventions.py --base origin/main: passes.
  • PPSA01748 (content 01.006.000), New Game into the first level:
    • Before the change (main 6830c9164 plus #8991's change, one run): stops on the refusal above at the end of the first-level load.
    • With the check relaxed this way (a local build that logs each partial pass and then runs it over the whole target): the run went past that point: the rest of the load, then the playable prologue (Peter's bedroom; picking up and inspecting an object works), then the load into the next chapter. No other stop in about an hour. All 200 logged partial passes were fast-clear eliminates over targets with cmask=0, dcc=0 under the 480x270 viewport scissor.

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 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: PPSA01748 #9704 (first level after New Game)
  • GPUs tested: NVIDIA GeForce RTX 4090, driver 615.78.08, Linux (CachyOS, kernel 7.2.9)
  • AI-assisted: yes

Tested and written by Claude (AI assistant) on a contributor's machine.

image image
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4964643540 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9694). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-22T08:47:08Z. --- ### What With #8991, Marvel's Guardians of the Galaxy (PPSA01748) gets past its menus. After New Game and the first level load, it stops in presentation on: ``` AGC graphics: CB metadata pass over part of a color target ``` **Cause:** the pass is a fast-clear eliminate (`CB_COLOR_CONTROL` mode 2) over three 1920x1080 color targets that have no CMASK and no DCC keys. The viewport covers the targets (`xs/xo = 960/960`, `ys/yo = 540/540`), but `PA_SC_MODE_CNTL_0` still enables the viewport scissor, and `PA_SC_VPORT_SCISSOR_0` is left at 480x270 from an earlier pass. `DecodeColorMetadataPass` requires every target to be covered, so it refuses. For these targets the pass changes nothing: `RunColorMetadataPass` touches a target only through its CMASK clear or its DCC keys. **Fix:** the coverage check applies only to targets with a CMASK or DCC keys. A partial pass over such a target is still refused as before, and FMASK decompress (which requires a CMASK) and resolves are unchanged. ### Tested Linux (CachyOS, kernel 7.2.9), GCC 16.2.1, Release, `BUILD_TESTING=ON`, RTX 4090 (NVIDIA 615.78.08). - `metadataPassTests` (`agc_driver_graphics`): the two partial-coverage cases (a scissor and a viewport that miss part of the target) now first check that a target without CMASK or DCC keys decodes with its target. Then they add DCC keys to the same state and require the refusal as before. - **Negative check:** with `State.cpp` restored to `main`, `agc_driver_graphics` fails on the new expectation. With the change, `agc_driver_graphics` and `agc_driver_graphics_maps_fallback` pass. `ctest -R '^agc_'` (866 tests): 862 pass and 1 skips. The three `agc_driver_sample_order*` tests fail ("2x scene with the standard locations: the slopes did not leave depth both at and below the clear value"), and they fail the same way on `main` d6eafa54d on this machine. - `python3 tools/check_conventions.py --base origin/main`: passes. - PPSA01748 (content 01.006.000), New Game into the first level: - Before the change (`main` 6830c9164 plus #8991's change, one run): stops on the refusal above at the end of the first-level load. - With the check relaxed this way (a local build that logs each partial pass and then runs it over the whole target): the run went past that point: the rest of the load, then the playable prologue (Peter's bedroom; picking up and inspecting an object works), then the load into the next chapter. No other stop in about an hour. All 200 logged partial passes were fast-clear eliminates over targets with `cmask=0`, `dcc=0` under the 480x270 viewport scissor. ### Checklist - [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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical 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: PPSA01748 #9704 (first level after New Game) - [x] GPUs tested: NVIDIA GeForce RTX 4090, driver 615.78.08, Linux (CachyOS, kernel 7.2.9) - [x] AI-assisted: yes *Tested and written by Claude (AI assistant) on a contributor's machine.* <img width="1184" height="693" alt="image" src="https://github.com/user-attachments/assets/8408a087-3c75-45e3-82d7-fd99ef89a7b6" /> <img width="1188" height="689" alt="image" src="https://github.com/user-attachments/assets/5c905815-e83f-4c26-8d0f-c3e670969e7c" />
MarcZX10 commented 2026-10-22 08:49:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T08:49:26Z.

Review: CHANGES_REQUESTED


The one-line relaxation is consistent with RunColorMetadataPass: targets with neither CMASK nor DCC metadata have no metadata work to perform, while the full-coverage refusal remains for targets whose metadata may be changed. The added negative assertions retain the refusal for keyed targets. I ran the current-main conventions check and git diff --check; both passed. A pairwise merge-tree with open #9597 is clean; that PR changes mipmapped DCC target decoding in a separate area, not this coverage condition.

Two repository requirements still need attention before approval:

  1. This changes the AGC driver. CONTRIBUTING requires the same focused test(s) on main and the PR with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1, using ctest -V, plus confirmation the layer was loaded and no new VUID- errors were introduced. The report includes the focused tests and GPU, but not those validation-layer runs or the main/change VUID comparison. Please attach both logs/results. The hosted product jobs are skipped on this PR; I could not run the AGC target in this checkout.
  2. The checklist says Unblocks: PPSA01748 (first level after New Game), but the repo requires the Game bring-up discussion number as well. I could not find a Game bring-up discussion for PPSA01748; #8991 is a merged PR, not that discussion. Please create or locate the title's Game bring-up discussion, link it on this line, and keep its open-PR/blocker summary current.

I found no code defect in the changed condition. These requests are for the required AGC validation evidence and title-tracking checklist.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5611563843 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9694#pullrequestreview-5611563843). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T08:49:26Z. **Review:** CHANGES_REQUESTED --- The one-line relaxation is consistent with `RunColorMetadataPass`: targets with neither CMASK nor DCC metadata have no metadata work to perform, while the full-coverage refusal remains for targets whose metadata may be changed. The added negative assertions retain the refusal for keyed targets. I ran the current-main conventions check and `git diff --check`; both passed. A pairwise merge-tree with open #9597 is clean; that PR changes mipmapped DCC target decoding in a separate area, not this coverage condition. Two repository requirements still need attention before approval: 1. This changes the AGC driver. CONTRIBUTING requires the same focused test(s) on `main` and the PR with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1`, using `ctest -V`, plus confirmation the layer was loaded and no new `VUID-` errors were introduced. The report includes the focused tests and GPU, but not those validation-layer runs or the main/change VUID comparison. Please attach both logs/results. The hosted product jobs are skipped on this PR; I could not run the AGC target in this checkout. 2. The checklist says `Unblocks: PPSA01748 (first level after New Game)`, but the repo requires the Game bring-up discussion number as well. I could not find a Game bring-up discussion for PPSA01748; #8991 is a merged PR, not that discussion. Please create or locate the title's Game bring-up discussion, link it on this line, and keep its open-PR/blocker summary current. I found no code defect in the changed condition. These requests are for the required AGC validation evidence and title-tracking checklist.
Tamalero commented 2026-10-22 09:01:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-22T09:01:58Z.


@MarcZX10 thanks for the review. Both items:

1. Validation-layer runs. Same machine as the description (RTX 4090, NVIDIA 615.78.08, Linux). main d6eafa54d and this PR (793e51a91), each a full build. Run as:

VK_LOADER_DEBUG=layer VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \
  ctest -V -R '^(agc_driver_graphics|agc_driver_graphics_maps_fallback|agc_metadata_pass|agc_driver_cmask_fast_clear)$'

agc_driver_graphics (which holds metadataPassTests) and its maps_fallback variant decode registers on a CPU-side Graphics::Context, so they create no Vulkan device. I added the two tests that run metadata passes on the GPU: agc_metadata_pass (agc_driver_recorder_tests --metadata-pass-only) and agc_driver_cmask_fast_clear. Validation-layers package: 1.4.363.0.

main d6eafa54d this PR
tests 4/4 pass 4/4 pass
layer loaded (Insert instance layer "VK_LAYER_KHRONOS_validation" and Inserted device layer from the loader) yes, in both GPU tests yes, in both GPU tests
VUID- messages VUID-vkCreateDevice-ppEnabledExtensionNames-01387 ×1 in each GPU test the same, ×1 in each GPU test
new VUID- — none

The one VUID on both sides is at device creation and comes before any of this PR's code runs: ppEnabledExtensionNames[13] Missing extension required to enable device extension VK_KHR_present_mode_fifo_latest_ready: VK_KHR_swapchain. It comes from these tests creating the device without a swapchain. It's pre-existing and unrelated to this change, but I can open a separate issue for it if you want.

Loader and result lines (PR run)
[Vulkan Loader] WARNING | LAYER: env var 'VK_INSTANCE_LAYERS' defined and adding layers "VK_LAYER_KHRONOS_validation"
[Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_KHRONOS_validation" (/usr/lib/libVkLayer_khronos_validation.so)
[Vulkan Loader] INFO | LAYER:   Inserted device layer "VK_LAYER_KHRONOS_validation" (/usr/lib/libVkLayer_khronos_validation.so)
Vulkan device: NVIDIA GeForce RTX 4090
Color metadata pass tests passed
CMASK fast clear draw and eliminate tests passed
Graphics validation tests passed
100% tests passed out of 4

2. Game bring-up discussion. There wasn't one for PPSA01748, so I opened it: #9704. The checklist line now links it.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336930225 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9694#issuecomment-6336930225). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-22T09:01:58Z. --- @MarcZX10 thanks for the review. Both items: **1. Validation-layer runs.** Same machine as the description (RTX 4090, NVIDIA 615.78.08, Linux). `main` d6eafa54d and this PR (793e51a91), each a full build. Run as: ``` VK_LOADER_DEBUG=layer VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 \ ctest -V -R '^(agc_driver_graphics|agc_driver_graphics_maps_fallback|agc_metadata_pass|agc_driver_cmask_fast_clear)$' ``` `agc_driver_graphics` (which holds `metadataPassTests`) and its `maps_fallback` variant decode registers on a CPU-side `Graphics::Context`, so they create no Vulkan device. I added the two tests that run metadata passes on the GPU: `agc_metadata_pass` (`agc_driver_recorder_tests --metadata-pass-only`) and `agc_driver_cmask_fast_clear`. Validation-layers package: 1.4.363.0. | | `main` d6eafa54d | this PR | |---|---|---| | tests | 4/4 pass | 4/4 pass | | layer loaded (`Insert instance layer "VK_LAYER_KHRONOS_validation"` and `Inserted device layer` from the loader) | yes, in both GPU tests | yes, in both GPU tests | | `VUID-` messages | `VUID-vkCreateDevice-ppEnabledExtensionNames-01387` ×1 in each GPU test | the same, ×1 in each GPU test | | new `VUID-` | — | none | The one VUID on both sides is at device creation and comes before any of this PR's code runs: `ppEnabledExtensionNames[13] Missing extension required to enable device extension VK_KHR_present_mode_fifo_latest_ready: VK_KHR_swapchain`. It comes from these tests creating the device without a swapchain. It's pre-existing and unrelated to this change, but I can open a separate issue for it if you want. <details><summary>Loader and result lines (PR run)</summary> ``` [Vulkan Loader] WARNING | LAYER: env var 'VK_INSTANCE_LAYERS' defined and adding layers "VK_LAYER_KHRONOS_validation" [Vulkan Loader] INFO | LAYER: Insert instance layer "VK_LAYER_KHRONOS_validation" (/usr/lib/libVkLayer_khronos_validation.so) [Vulkan Loader] INFO | LAYER: Inserted device layer "VK_LAYER_KHRONOS_validation" (/usr/lib/libVkLayer_khronos_validation.so) Vulkan device: NVIDIA GeForce RTX 4090 Color metadata pass tests passed CMASK fast clear draw and eliminate tests passed Graphics validation tests passed 100% tests passed out of 4 ``` </details> **2. Game bring-up discussion.** There wasn't one for PPSA01748, so I opened it: #9704. The checklist line now links it. *Tested and written by Claude (AI assistant) on a contributor's machine.*
MarcZX10 commented 2026-10-22 12:26:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T12:26:18Z.

Review: COMMENTED


Thanks for adding the title's Game bring-up discussion and the focused validation-layer comparison. The new report documents same-machine runs on main and this PR, confirms the requested layer was loaded for both GPU tests, and shows no new VUIDs. The checklist now links PPSA01748 to #9704, whose current blocker section records the remaining AMD/RADV issue separately from this AnyPS5 fix. I independently rechecked the exact head: current-main conventions pass, is clean, and a merge-tree with current main is clean. I did not rerun the AGC binaries locally because this checkout has no configured AGC build and the filesystem is full; I am relying on the clearly attributed contributor-machine results for those runs. I found no remaining blocker in the diff or required validation evidence.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5614092496 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9694#pullrequestreview-5614092496). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T12:26:18Z. **Review:** COMMENTED --- Thanks for adding the title's Game bring-up discussion and the focused validation-layer comparison. The new report documents same-machine runs on main and this PR, confirms the requested layer was loaded for both GPU tests, and shows no new VUIDs. The checklist now links PPSA01748 to #9704, whose current blocker section records the remaining AMD/RADV issue separately from this AnyPS5 fix. I independently rechecked the exact head: current-main conventions pass, is clean, and a merge-tree with current main is clean. I did not rerun the AGC binaries locally because this checkout has no configured AGC build and the filesystem is full; I am relying on the clearly attributed contributor-machine results for those runs. I found no remaining blocker in the diff or required validation evidence.
MarcZX10 commented 2026-10-22 12:26:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T12:26:24Z.

Review: APPROVED


The requested title tracking and validation evidence are now present. I reviewed the code path and focused test additions, verified conventions, diff cleanliness and current-main mergeability, and found no remaining blocker.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5614093523 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9694#pullrequestreview-5614093523). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T12:26:24Z. **Review:** APPROVED --- The requested title tracking and validation evidence are now present. I reviewed the code path and focused test additions, verified conventions, diff cleanliness and current-main mergeability, and found no remaining blocker.
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!9694
No description provided.