fix(agc): render DCC-compressed 4_4_4_4 unorm color targets #28311

Open
zeezey wants to merge 5 commits from upstream-pr/28311 into main
zeezey commented 2026-11-29 23:37:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by zeezey on 2026-11-29T23:37:01Z.


What

A one-sample, one-mip 4_4_4_4 unorm color target with DCC enabled renders instead of throwing DCC-compressed 4_4_4_4 unorm color targets are unsupported. Built on #27966 (head e2e97886ee), which accepts 4_4_4_4 targets under every component order (they render into an R16_UINT attachment; main accepts STD_REV only); lgqdaxia suggested this follow #27966 as its own PR. Two commits:

  1. fix(agc): render DCC-compressed 4_4_4_4 unorm color targets, the change.

    • The target renders into its R16_UINT attachment like the other DCC targets: its texels are stored uncompressed and its keys end as 0xff.
    • That attachment has one 16-bit channel, so a DCC clear code expanded in it gives 0001 as 0xffff and 1110 as 0. ColorTargetDccClearFormat gives R4G4B4A4_UNORM_PACK16 for a 4_4_4_4 target (the target's own format for every other one), with a DCC layout entry for it, and the clear texel, the non-resident fill and the alpha-position rule (DccAlphaOnMsb) use it: 0000, 0001, 1110 and 1111 fill four 4-bit channels, with alpha in bits 12-15 under STD and ALT and in bits 0-3 under STD_REV and ALT_REV.
    • The resident R16_UINT image still fills 0001 and 1110 as one channel, so a draw that binds the target (after syncing pending key writes) and a CB fast-clear eliminate or DCC decompress over it store the four-nibble texels into guest memory and refresh the resident image instead of trusting its upload.
    • Multisampled and mipmapped DCC 4_4_4_4 targets still throw. A mip chain's resident surface would expand 0001 and 1110 as one channel in the mips that no draw materializes. DCC 10_11_11 unorm and DCC 11_11_10 float targets throw as before. The message now carries CB_COLOR_INFO, CB_COLOR_ATTRIB, CB_COLOR_ATTRIB3, the extent, the mips and the samples. The first accepted DCC 4_4_4_4 target logs one [gpu] first DCC 4_4_4_4 unorm color target line with its registers.
    • The debt fragment records what is still off: a use of the resident R16_UINT image before such a draw or pass sees the one-channel value, a write through it keeps that value, and a read of the surface as a 4_4_4_4 texture (B4G4R4A4_UNORM_PACK16, which has no DCC layout entry) under 0001, 1110 or 1111 keys reads the stored texels instead of the clear.

    lgqdaxia tested this commit as c58e1457c183 (see Tested). Since then it was rebased onto #27966 without conflicts, and three changes came from review: the refusal of mipmapped targets; in the new branch of materializeRegisterClear, the register clear texel (rather than the 0001 or 1110 one) passed to storeClearTexels, which uses it only for keys that read as a register clear, with the key byte count computed once for both branches; and a rewritten debt entry.

  2. test(agc): cover more DCC 4_4_4_4 target clears and the mip refusal, tests only:

    • agc_driver_packed_unorm4444_dcc_target (and its run with APS5_NO_RESIDENT_TARGETS=1) runs a CB fast-clear eliminate and a DCC decompress over a target after a draw into it, under 0001 and 1110 keys and each component swap. It checks the stored four-nibble texels, the uncompressed keys, and that a following draw keeps the clear outside its scissor.
    • The same test draws into such a target, under the GPU mutex, right after a GPU fill of its keys with 0001 or 1110 that is still pending, and checks the same. A device whose VulkanDevice::FillBuffer records no fill skips these cases and prints so; on the RTX 4090 and on lavapipe they ran.
    • agc_driver_graphics checks that a mipmapped DCC 4_4_4_4 target (four mips, SW_64KB_R_X, pipe-aligned) is refused under each component swap, and that the same target without DCC decodes.

No new switch.

Tested

lgqdaxia tested the first commit as c58e1457c183 on #28197's head, on an NVIDIA GeForce RTX 3080 Laptop GPU (driver 621.14, Windows 11): the fast-clear pixels matched for all four component orders with resident targets on and off, both Vulkan tests passed with no skips or validation errors, and the patch applied cleanly to #27966 at e2e97886ee. That run predates the review changes and the second commit.

Here: Windows 11 Pro 10.0.26300, WinLibs MinGW-w64 GCC 15.2.0, Ninja, Release, -DBUILD_TESTING=ON -DANYPS5_RELINKER_CLI=ON -DANYPS5_VIDEO_OUT_TEST_DRIVER=windows, NVIDIA GeForce RTX 4090 (driver 621.24), Khronos validation layer from Vulkan SDK 1.4.363. Every run below except the build.yml steps had ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer. #27966's head and this branch were built in separate build directories with the same toolchain and options.

  • The complete ctest (no -R, -j 8, --timeout 300) on #27966's head and on this PR: 7354 and 7356 tests (the two more are the new test's runs), 7315 and 7318 passed, 36 skipped on both. No line reports the layer missing; it is inserted 2137 and 2139 times. Both logs have the same 89 Validation Warning lines (Undefined-Value-ShaderOutputNotConsumed-DynamicRendering 84, Undefined-Value-OutputNotWritten-DynamicRendering 3, Undefined-Value-ShaderOutputNotConsumed 1, VALIDATION-SETTINGS 1) and no VUID-, SYNC-HAZARD or Validation Error line.

    • Not passing on both: agc_driver_linear_target_import_creation, which then failed 5 of 5 times alone on each.
    • Not passing only on #27966's head: frame_capture_minimize and guest_pthread_mutex_contention.
    • Not passing only on this PR: windows_write_watch ("cannot restore full resident run protection").
    • Those three ran 5 more times alone on each side, alternating: frame_capture_minimize and guest_pthread_mutex_contention passed 5 of 5 on both; windows_write_watch passed 5 of 5 on this PR and 4 of 5 on #27966's head, where it failed once.
  • Every test matching dcc|4444|clear|fast_clear|blend|interlock|sample, 20 times with ctest -j 8, alternating between #27966's head (201 tests) and this PR (203; the two more are the new test's runs): every run passed, with the same 5 skipped on both (agc_driver_msaa_dcc_compared_import_2, _4 and _8, agc_driver_partially_committed_volume_page_samples, agc_driver_sample_order_grid_reference). Each run's log shows the layer inserted (182 times per run on #27966's head, 184 on this PR) and no was not found, VUID-, SYNC-HAZARD or Validation Error line; both have the same 31 Validation Warning lines per run (30 Undefined-Value-ShaderOutputNotConsumed-DynamicRendering, 1 VALIDATION-SETTINGS).

  • The same set plus the 61 tests of the two changed test executables (agc_driver_graphics_tests and agc_driver_packed_unorm4444_dcc_target_tests), once on each side under each of ten switches read on these paths: APS5_NO_RESIDENT_TARGETS, APS5_NO_KEY_FAST_PATH, APS5_NO_TARGET_MEMO, APS5_NO_DCC_MIP_FAST_CLEAR (read after the mip refusal, so no accepted 4_4_4_4 target reaches it), APS5_KEYS_FILL_CLEAR=1, APS5_CPU_DCC_KEYS, APS5_NO_KEYS_FILL_MEMO, APS5_NO_DCC_WORD_SCAN, APS5_NO_RECORDED_CLEAR, and APS5_NO_PASS_ATTACHMENT_MEMO with APS5_DRAW_PIPELINE=1. The tests that do not pass are the same on both sides under every switch (12, 5, 0, 1, 0, 1, 0, 0, 0 and 0), the new test's two runs pass under each, and no log has a VUID-, SYNC-HAZARD or Validation Error line.

  • The 61 tests of the two changed test executables, 20 times in a row, one at a time: every run passed, no VUID- or Validation line. The longest were agc_graphics_profile_draw (21.98 s) and agc_driver_graphics (20.13 s), measured while the validation gate below was building; the new test's runs took at most 2.26 s.

  • The first commit alone (its own test sources, with the second commit's tests left out): the new test's two runs and agc_driver_graphics pass, and of the 203 tests matching the pattern above, 198 pass and 5 skip, with no VUID- line.

  • Each part of the change was disabled in turn to see which test catches it (the first two and the two lines below on the code before the review changes, whose disabled lines are the same; the mip refusal on this code):

    • with the four-nibble store in the draw path disabled, a draw under 0001 keys leaves 0xffff outside the scissor where 0xf000 belongs;
    • with the metadata pass trusting the resident image's upload, the new eliminate case fails the same way;
    • with the mip refusal removed, the new refusal case fails.

    Two lines are not shown to be needed by these tests. The cases also pass with the refresh after the metadata pass's store removed, and with the explicit key sync in materializeRegisterClear removed. In the second case the lookup already knows the pending fill's keys, and the store reads the clear code without that sync, so the pending-fill case checks the result, not that sync.

  • tools/vulkan_validation_gate.py (main's copy), #27966's head against this PR, --gpu NVIDIA --repeat 20 --timeout 3600 with the default 30 s test timeout:

    • First with the 63 tests of the area set that match dcc|4444|clear and create a Vulkan instance on both sides: exit 1, from three tests only. agc_driver_msaa_dcc_compared_import_2, _4 and _8 skip on Windows ("Linux comparison mode only: Windows host imports settle on a second queue or keep their write watch") in every iteration on both sides, and the gate counts a skipped selected test as a problem. No new diagnostic.
    • Then without those three (60 tests): exit 0, no problems and no new diagnostics. All 2400 test runs passed with the layer inserted, the longest in 1.88 s. The only validation message is Undefined-Value-ShaderOutputNotConsumed-DynamicRendering in agc_driver_packed_unorm4444_partial_write, 200 times on each side.
    • The new test's runs are not on #27966's head, so the gate cannot take them; they are in the 20 runs above.
  • Linux: Ubuntu 24.04.5 (a Docker container), GCC 13.3.0, Ninja, Release, lavapipe from Mesa 25.2.8 (llvmpipe, LLVM 20.1.2), Khronos validation layer 1.4.335, the same four variables. The complete ctest (-j 6) on #27966's head and on this PR: 7243 and 7245 tests, 6739 and 6741 passed, 312 skipped on both, and the same 192 do not pass on both (186 of them print that the write watch is unavailable because the container does not permit userfaultfd; the other six are five Python tool tests and one replay test that timed out). No VUID-, SYNC-HAZARD or Validation Error line, and the same 78 Validation Warning lines on both. The new test's two runs and agc_driver_graphics, 20 times one at a time: all passed (the pending-fill cases ran), the longest agc_driver_graphics at 17.31 s and the new test's runs at 0.84 s; the 61 tests of the changed executables once: all pass; the same three under each switch above: all pass.

  • The pull-request steps of the build.yml windows job, run here with main's copies of the tools over the ten files this PR changes against main (which include #27966's), without the four validation variables as in CI: check_test_registration.py build passes, build_mingw_host_only_tests.py builds its 83 host-only test executables, and build_changed_guest_tests.py ran 6137 tests, all passing but agc_driver_linear_target_import_creation, which fails on #27966's head too.

  • python3 -I tools/check_conventions.py --base e2e97886ee (and with --base origin/main, which covers #27966's commits too), with main's checker, with this title and body: all checks passed. tools/debt_fold.py --check and tools/check_test_registration.py build pass. The branch merges into current main (1f27e2abfa) without conflicts.

  • tools/pr_overlap.py --branch, from main, with a local change that skips the nine open PRs whose heads it cannot fetch (among them #7642), reports two line overlaps:

    • #9748, on lines of State.cpp that #27966 already changes (#9748 conflicts with #27966 alone too);
    • #28118, whose A1R5G5B5_UNORM_PACK16 entry goes on the same line of the DCC layout table (LayoutFor in DccMetadata.cpp) as this PR's R4G4B4A4_UNORM_PACK16 entry. Whichever merges second keeps both entries.

    It ends with "overlap check failed closed", because older open PRs that conflict with main touch the same files and could not be compared.

  • Three open PRs from today touch the same files with no textual conflict (git merge-tree of each head with this branch is clean), each for a different case:

    • #28192 (GFX10 single-component DCC clears) changes FillDccClear in DccMetadata.cpp so that a one-channel format whose alpha is not on the MSB fills its channel as colour on GFX10. This PR's clears of 4_4_4_4 targets use the four-channel R4G4B4A4_UNORM_PACK16 layout, which that change does not reach. With it, the one-channel value that the resident R16_UINT image shows before the first draw flips for STD_REV and ALT_REV (0 for 0001, 0xffff for 1110), so whichever of the two merges second should update the "0xffff and 0" of this PR's debt entry. With #28192's commit picked onto this branch, the area set above, the 61 tests of the changed executables (agc_driver_graphics runs #28192's new single-component clear checks in TextureFormat.cpp), agc_driver_dcc_key_presync (its new case) and texture_format_lookup pass: 257 tests, the same 5 skipped, no VUID- line.
    • #28218 and #28229 (quad-masked early tests; #28229 contains #28218's commit) change the depth and stencil paths of quad-masked draws in Draw.cpp, and quadPixelMaskTests and sampleOrderTests in tests/Graphics.cpp. #28229 adds one line to prepareDraw, away from this PR's line there; neither touches the other functions this PR changes.
  • PPSA38500: our boots of a longer local stack that includes the first commit (before the review changes) got past this stop. The first DCC 4_4_4_4 target they logged (CB_COLOR_INFO 0x1000884c, CB_COLOR_ATTRIB 0x00000000, 2560x1440, 1 mip) is not one that the mip refusal affects. This exact branch was not booted.

  • Not tested: a console, other GPUs.

Checklist

  • Based on #27966's head e2e97886ee, not on current main (see Depends on); 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: #27966
  • Fixes: none
  • Unblocks: PPSA38500 #27523
  • GPUs tested: NVIDIA GeForce RTX 4090, driver 621.24, Windows 11 Pro 10.0.26300 (complete ctest, #27966 and this PR, Khronos validation layer 1.4.363); lavapipe from Mesa 25.2.8 on Ubuntu 24.04.5 (complete ctest, Khronos validation layer 1.4.335); NVIDIA GeForce RTX 3080 Laptop GPU, driver 621.14, Windows 11 (the first commit as c58e1457c183, before the review changes, tested by lgqdaxia)
  • AI-assisted: yes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added support for single-sample, single-mip DCC-compressed 4_4_4_4 UNORM color targets, including clear handling across component swaps.
    • Added support for additional component swaps and replacement-only blending behavior on 4_4_4_4 targets.
  • Bug Fixes

    • Corrected clear-code interpretation and texture updates for supported packed targets.
    • DCC is now rejected for unsupported packed-target configurations, including multisampled and mipmapped targets.
  • Tests

    • Added coverage for packed-target rendering, partial writes, blending, and DCC clear behavior.
  • Documentation

    • Documented supported DCC behavior and limitations for 4_4_4_4 color targets.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5556379498 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28311). Originally posted by [zeezey](https://github.com/zeezey) on 2026-11-29T23:37:01Z. --- ### What A one-sample, one-mip 4_4_4_4 unorm color target with DCC enabled renders instead of throwing `DCC-compressed 4_4_4_4 unorm color targets are unsupported`. Built on #27966 (head `e2e97886ee`), which accepts 4_4_4_4 targets under every component order (they render into an R16_UINT attachment; `main` accepts STD_REV only); lgqdaxia [suggested](https://github.com/boykopovar/AnyPS5/pull/28197#issuecomment-7251232182) this follow #27966 as its own PR. Two commits: 1. `fix(agc): render DCC-compressed 4_4_4_4 unorm color targets`, the change. - The target renders into its R16_UINT attachment like the other DCC targets: its texels are stored uncompressed and its keys end as 0xff. - That attachment has one 16-bit channel, so a DCC clear code expanded in it gives 0001 as 0xffff and 1110 as 0. `ColorTargetDccClearFormat` gives `R4G4B4A4_UNORM_PACK16` for a 4_4_4_4 target (the target's own format for every other one), with a DCC layout entry for it, and the clear texel, the non-resident fill and the alpha-position rule (`DccAlphaOnMsb`) use it: 0000, 0001, 1110 and 1111 fill four 4-bit channels, with alpha in bits 12-15 under STD and ALT and in bits 0-3 under STD_REV and ALT_REV. - The resident R16_UINT image still fills 0001 and 1110 as one channel, so a draw that binds the target (after syncing pending key writes) and a CB fast-clear eliminate or DCC decompress over it store the four-nibble texels into guest memory and refresh the resident image instead of trusting its upload. - Multisampled and mipmapped DCC 4_4_4_4 targets still throw. A mip chain's resident surface would expand 0001 and 1110 as one channel in the mips that no draw materializes. DCC 10_11_11 unorm and DCC 11_11_10 float targets throw as before. The message now carries CB_COLOR_INFO, CB_COLOR_ATTRIB, CB_COLOR_ATTRIB3, the extent, the mips and the samples. The first accepted DCC 4_4_4_4 target logs one `[gpu] first DCC 4_4_4_4 unorm color target` line with its registers. - The debt fragment records what is still off: a use of the resident R16_UINT image before such a draw or pass sees the one-channel value, a write through it keeps that value, and a read of the surface as a 4_4_4_4 texture (`B4G4R4A4_UNORM_PACK16`, which has no DCC layout entry) under 0001, 1110 or 1111 keys reads the stored texels instead of the clear. lgqdaxia tested this commit as `c58e1457c183` (see Tested). Since then it was rebased onto #27966 without conflicts, and three changes came from review: the refusal of mipmapped targets; in the new branch of `materializeRegisterClear`, the register clear texel (rather than the 0001 or 1110 one) passed to `storeClearTexels`, which uses it only for keys that read as a register clear, with the key byte count computed once for both branches; and a rewritten debt entry. 2. `test(agc): cover more DCC 4_4_4_4 target clears and the mip refusal`, tests only: - `agc_driver_packed_unorm4444_dcc_target` (and its run with `APS5_NO_RESIDENT_TARGETS=1`) runs a CB fast-clear eliminate and a DCC decompress over a target after a draw into it, under 0001 and 1110 keys and each component swap. It checks the stored four-nibble texels, the uncompressed keys, and that a following draw keeps the clear outside its scissor. - The same test draws into such a target, under the GPU mutex, right after a GPU fill of its keys with 0001 or 1110 that is still pending, and checks the same. A device whose `VulkanDevice::FillBuffer` records no fill skips these cases and prints so; on the RTX 4090 and on lavapipe they ran. - `agc_driver_graphics` checks that a mipmapped DCC 4_4_4_4 target (four mips, SW_64KB_R_X, pipe-aligned) is refused under each component swap, and that the same target without DCC decodes. No new switch. ### 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. --> lgqdaxia [tested](https://github.com/boykopovar/AnyPS5/pull/28197#issuecomment-7252198437) the first commit as `c58e1457c183` on #28197's head, on an NVIDIA GeForce RTX 3080 Laptop GPU (driver 621.14, Windows 11): the fast-clear pixels matched for all four component orders with resident targets on and off, both Vulkan tests passed with no skips or validation errors, and the patch applied cleanly to #27966 at `e2e97886ee`. That run predates the review changes and the second commit. Here: Windows 11 Pro 10.0.26300, WinLibs MinGW-w64 GCC 15.2.0, Ninja, Release, `-DBUILD_TESTING=ON -DANYPS5_RELINKER_CLI=ON -DANYPS5_VIDEO_OUT_TEST_DRIVER=windows`, NVIDIA GeForce RTX 4090 (driver 621.24), Khronos validation layer from Vulkan SDK 1.4.363. Every run below except the `build.yml` steps had `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and `VK_LOADER_DEBUG=layer`. #27966's head and this branch were built in separate build directories with the same toolchain and options. - The complete `ctest` (no `-R`, `-j 8`, `--timeout 300`) on #27966's head and on this PR: 7354 and 7356 tests (the two more are the new test's runs), 7315 and 7318 passed, 36 skipped on both. No line reports the layer missing; it is inserted 2137 and 2139 times. Both logs have the same 89 `Validation Warning` lines (`Undefined-Value-ShaderOutputNotConsumed-DynamicRendering` 84, `Undefined-Value-OutputNotWritten-DynamicRendering` 3, `Undefined-Value-ShaderOutputNotConsumed` 1, `VALIDATION-SETTINGS` 1) and no `VUID-`, `SYNC-HAZARD` or `Validation Error` line. - Not passing on both: `agc_driver_linear_target_import_creation`, which then failed 5 of 5 times alone on each. - Not passing only on #27966's head: `frame_capture_minimize` and `guest_pthread_mutex_contention`. - Not passing only on this PR: `windows_write_watch` ("cannot restore full resident run protection"). - Those three ran 5 more times alone on each side, alternating: `frame_capture_minimize` and `guest_pthread_mutex_contention` passed 5 of 5 on both; `windows_write_watch` passed 5 of 5 on this PR and 4 of 5 on #27966's head, where it failed once. - Every test matching `dcc|4444|clear|fast_clear|blend|interlock|sample`, 20 times with `ctest -j 8`, alternating between #27966's head (201 tests) and this PR (203; the two more are the new test's runs): every run passed, with the same 5 skipped on both (`agc_driver_msaa_dcc_compared_import_2`, `_4` and `_8`, `agc_driver_partially_committed_volume_page_samples`, `agc_driver_sample_order_grid_reference`). Each run's log shows the layer inserted (182 times per run on #27966's head, 184 on this PR) and no `was not found`, `VUID-`, `SYNC-HAZARD` or `Validation Error` line; both have the same 31 `Validation Warning` lines per run (30 `Undefined-Value-ShaderOutputNotConsumed-DynamicRendering`, 1 `VALIDATION-SETTINGS`). - The same set plus the 61 tests of the two changed test executables (`agc_driver_graphics_tests` and `agc_driver_packed_unorm4444_dcc_target_tests`), once on each side under each of ten switches read on these paths: `APS5_NO_RESIDENT_TARGETS`, `APS5_NO_KEY_FAST_PATH`, `APS5_NO_TARGET_MEMO`, `APS5_NO_DCC_MIP_FAST_CLEAR` (read after the mip refusal, so no accepted 4_4_4_4 target reaches it), `APS5_KEYS_FILL_CLEAR=1`, `APS5_CPU_DCC_KEYS`, `APS5_NO_KEYS_FILL_MEMO`, `APS5_NO_DCC_WORD_SCAN`, `APS5_NO_RECORDED_CLEAR`, and `APS5_NO_PASS_ATTACHMENT_MEMO` with `APS5_DRAW_PIPELINE=1`. The tests that do not pass are the same on both sides under every switch (12, 5, 0, 1, 0, 1, 0, 0, 0 and 0), the new test's two runs pass under each, and no log has a `VUID-`, `SYNC-HAZARD` or `Validation Error` line. - The 61 tests of the two changed test executables, 20 times in a row, one at a time: every run passed, no `VUID-` or `Validation` line. The longest were `agc_graphics_profile_draw` (21.98 s) and `agc_driver_graphics` (20.13 s), measured while the validation gate below was building; the new test's runs took at most 2.26 s. - The first commit alone (its own test sources, with the second commit's tests left out): the new test's two runs and `agc_driver_graphics` pass, and of the 203 tests matching the pattern above, 198 pass and 5 skip, with no `VUID-` line. - Each part of the change was disabled in turn to see which test catches it (the first two and the two lines below on the code before the review changes, whose disabled lines are the same; the mip refusal on this code): - with the four-nibble store in the draw path disabled, a draw under 0001 keys leaves `0xffff` outside the scissor where `0xf000` belongs; - with the metadata pass trusting the resident image's upload, the new eliminate case fails the same way; - with the mip refusal removed, the new refusal case fails. Two lines are not shown to be needed by these tests. The cases also pass with the refresh after the metadata pass's store removed, and with the explicit key sync in `materializeRegisterClear` removed. In the second case the lookup already knows the pending fill's keys, and the store reads the clear code without that sync, so the pending-fill case checks the result, not that sync. - `tools/vulkan_validation_gate.py` (`main`'s copy), #27966's head against this PR, `--gpu NVIDIA --repeat 20 --timeout 3600` with the default 30 s test timeout: - First with the 63 tests of the area set that match `dcc|4444|clear` and create a Vulkan instance on both sides: exit 1, from three tests only. `agc_driver_msaa_dcc_compared_import_2`, `_4` and `_8` skip on Windows ("Linux comparison mode only: Windows host imports settle on a second queue or keep their write watch") in every iteration on both sides, and the gate counts a skipped selected test as a problem. No new diagnostic. - Then without those three (60 tests): exit 0, no problems and no new diagnostics. All 2400 test runs passed with the layer inserted, the longest in 1.88 s. The only validation message is `Undefined-Value-ShaderOutputNotConsumed-DynamicRendering` in `agc_driver_packed_unorm4444_partial_write`, 200 times on each side. - The new test's runs are not on #27966's head, so the gate cannot take them; they are in the 20 runs above. - Linux: Ubuntu 24.04.5 (a Docker container), GCC 13.3.0, Ninja, Release, lavapipe from Mesa 25.2.8 (llvmpipe, LLVM 20.1.2), Khronos validation layer 1.4.335, the same four variables. The complete `ctest` (`-j 6`) on #27966's head and on this PR: 7243 and 7245 tests, 6739 and 6741 passed, 312 skipped on both, and the same 192 do not pass on both (186 of them print that the write watch is unavailable because the container does not permit userfaultfd; the other six are five Python tool tests and one replay test that timed out). No `VUID-`, `SYNC-HAZARD` or `Validation Error` line, and the same 78 `Validation Warning` lines on both. The new test's two runs and `agc_driver_graphics`, 20 times one at a time: all passed (the pending-fill cases ran), the longest `agc_driver_graphics` at 17.31 s and the new test's runs at 0.84 s; the 61 tests of the changed executables once: all pass; the same three under each switch above: all pass. - The pull-request steps of the `build.yml` windows job, run here with `main`'s copies of the tools over the ten files this PR changes against `main` (which include #27966's), without the four validation variables as in CI: `check_test_registration.py build` passes, `build_mingw_host_only_tests.py` builds its 83 host-only test executables, and `build_changed_guest_tests.py` ran 6137 tests, all passing but `agc_driver_linear_target_import_creation`, which fails on #27966's head too. - `python3 -I tools/check_conventions.py --base e2e97886ee` (and with `--base origin/main`, which covers #27966's commits too), with `main`'s checker, with this title and body: all checks passed. `tools/debt_fold.py --check` and `tools/check_test_registration.py build` pass. The branch merges into current `main` (`1f27e2abfa`) without conflicts. - `tools/pr_overlap.py --branch`, from `main`, with a local change that skips the nine open PRs whose heads it cannot fetch (among them #7642), reports two line overlaps: - #9748, on lines of `State.cpp` that #27966 already changes (#9748 conflicts with #27966 alone too); - #28118, whose `A1R5G5B5_UNORM_PACK16` entry goes on the same line of the DCC layout table (`LayoutFor` in `DccMetadata.cpp`) as this PR's `R4G4B4A4_UNORM_PACK16` entry. Whichever merges second keeps both entries. It ends with "overlap check failed closed", because older open PRs that conflict with `main` touch the same files and could not be compared. - Three open PRs from today touch the same files with no textual conflict (`git merge-tree` of each head with this branch is clean), each for a different case: - #28192 (GFX10 single-component DCC clears) changes `FillDccClear` in `DccMetadata.cpp` so that a one-channel format whose alpha is not on the MSB fills its channel as colour on GFX10. This PR's clears of 4_4_4_4 targets use the four-channel `R4G4B4A4_UNORM_PACK16` layout, which that change does not reach. With it, the one-channel value that the resident R16_UINT image shows before the first draw flips for STD_REV and ALT_REV (0 for 0001, 0xffff for 1110), so whichever of the two merges second should update the "0xffff and 0" of this PR's debt entry. With #28192's commit picked onto this branch, the area set above, the 61 tests of the changed executables (`agc_driver_graphics` runs #28192's new single-component clear checks in `TextureFormat.cpp`), `agc_driver_dcc_key_presync` (its new case) and `texture_format_lookup` pass: 257 tests, the same 5 skipped, no `VUID-` line. - #28218 and #28229 (quad-masked early tests; #28229 contains #28218's commit) change the depth and stencil paths of quad-masked draws in `Draw.cpp`, and `quadPixelMaskTests` and `sampleOrderTests` in `tests/Graphics.cpp`. #28229 adds one line to `prepareDraw`, away from this PR's line there; neither touches the other functions this PR changes. - PPSA38500: our boots of a longer local stack that includes the first commit (before the review changes) got past this stop. The first DCC 4_4_4_4 target they logged (`CB_COLOR_INFO 0x1000884c`, `CB_COLOR_ATTRIB 0x00000000`, 2560x1440, 1 mip) is not one that the mip refusal affects. This exact branch was not booted. - Not tested: a console, other GPUs. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on #27966's head `e2e97886ee`, not on current `main` (see Depends on); 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: #27966 - [x] Fixes: none - [x] Unblocks: PPSA38500 #27523 - [x] GPUs tested: NVIDIA GeForce RTX 4090, driver 621.24, Windows 11 Pro 10.0.26300 (complete ctest, #27966 and this PR, Khronos validation layer 1.4.363); lavapipe from Mesa 25.2.8 on Ubuntu 24.04.5 (complete ctest, Khronos validation layer 1.4.335); NVIDIA GeForce RTX 3080 Laptop GPU, driver 621.14, Windows 11 (the first commit as `c58e1457c183`, before the review changes, tested by lgqdaxia) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **New Features** * Added support for single-sample, single-mip DCC-compressed 4_4_4_4 UNORM color targets, including clear handling across component swaps. * Added support for additional component swaps and replacement-only blending behavior on 4_4_4_4 targets. * **Bug Fixes** * Corrected clear-code interpretation and texture updates for supported packed targets. * DCC is now rejected for unsupported packed-target configurations, including multisampled and mipmapped targets. * **Tests** * Added coverage for packed-target rendering, partial writes, blending, and DCC clear behavior. * **Documentation** * Documented supported DCC behavior and limitations for 4_4_4_4 color targets. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
MarcZX10 commented 2026-11-29 23:43:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T23:43:27Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the remaining resident image and texture-read limitations are documented as technical debt.

What I ran

Reviewed head 9f73b6670c29e37ddccba41a29ac3fd1040c463e using the prepared diff and the pinned repo_read.py reader. No tests were run by me; test results in the description are author-reported.

Results

Check Result Note
Diff and changed code passed Targeted review completed
Tests in this review not run Author reports Windows and lavapipe runs

Findings

Blocking

None.

Non-blocking

None.

Not verified

I read all 10 changed files listed as reviewed in the manifest, including the full Graphics.cpp change via the reader. I did not independently reproduce the reported test runs, build, or verify behavior on a console or other GPUs. The manifest lists no excluded changed files.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6105430602 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28311#pullrequestreview-6105430602). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-29T23:43:27Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the remaining resident image and texture-read limitations are documented as technical debt. ## What I ran Reviewed head `9f73b6670c29e37ddccba41a29ac3fd1040c463e` using the prepared diff and the pinned `repo_read.py` reader. No tests were run by me; test results in the description are author-reported. ## Results | Check | Result | Note | |---|---|---| | Diff and changed code | passed | Targeted review completed | | Tests in this review | not run | Author reports Windows and lavapipe runs | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified I read all 10 changed files listed as reviewed in the manifest, including the full `Graphics.cpp` change via the reader. I did not independently reproduce the reported test runs, build, or verify behavior on a console or other GPUs. The manifest lists no excluded changed files. ## To get this to a good state Nothing is required.
coderabbitai[bot] commented 2026-11-29 23:46:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-29T23:46:25Z.

Review: COMMENTED


Architecture findings (2)

Advisory architecture findings (2)

  • Trivial — For the newly admitted packed DCC targets, draw and metadata materialization use a four-nibble clear, but sampled or storage use before materialization can observe a different value, and storage writes can preserve it. The metadata pass excludes a clean upload as proof for the affected keys but still accepts a matching pending resident image without checking its packed texel contents. The representation mismatch is observed; incorrect publication through that shortcut is not established.
  • Trivial — The newly reachable packed clear path writes guest texels before checking whether the complete metadata range can be written. If that check rejects the update, texels have changed but keys have not, and the subsequent resident refresh is skipped. The base rejected this target configuration before it reached that transition.
Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2a479d71-04bb-44fb-be3f-a03f6ba680a2
Commits

Reviewing files that changed from the base of the PR and between 1f27e2abfa and 9f73b6670c.

Files selected for processing: 10

  • core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp
  • core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp
  • core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp
  • core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp
  • core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
  • core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_packed_unorm4444_dcc_target_tests.cmake
  • core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444ColorTarget.cpp
  • core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444DccTarget.cpp
  • core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444PartialWrite.cpp
  • docs/dev/debt/changes/agc-dcc-4444-color-targets.md

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6105443482 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28311#pullrequestreview-6105443482). Originally posted by [coderabbitai[bot]](https://github.com/apps/coderabbitai) on 2026-11-29T23:46:25Z. **Review:** COMMENTED --- <!-- coderabbit-ai-generated:v1 --> **Architecture findings (2)** <details> <summary>Advisory architecture findings (2)</summary> <dl> <dd> <br> - **Trivial** — For the newly admitted packed DCC targets, draw and metadata materialization use a four-nibble clear, but sampled or storage use before materialization can observe a different value, and storage writes can preserve it. The metadata pass excludes a clean upload as proof for the affected keys but still accepts a matching pending resident image without checking its packed texel contents. The representation mismatch is observed; incorrect publication through that shortcut is not established. - **Trivial** — The newly reachable packed clear path writes guest texels before checking whether the complete metadata range can be written. If that check rejects the update, texels have changed but keys have not, and the subsequent resident refresh is skipped. The base rejected this target configuration before it reached that transition. </dd> </dl> </details> <h6> <details> <summary><picture><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/info.svg" width="12" height="12" align="absmiddle" alt=""></picture> Review info</summary> <dl> <dd> <br> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/cog.svg" width="16" height="16" align="absmiddle" alt=""></picture> Run configuration</summary> <dl> <dd> <br> - **Source mode**: Auto - **Repository**: Unavailable - **Branch**: Unavailable - **File**: No configuration file from this repository applied - **Commit**: Unavailable - **Layers**: defaults - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `2a479d71-04bb-44fb-be3f-a03f6ba680a2` </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/git-commit-horizontal.svg" width="16" height="16" align="absmiddle" alt=""></picture> Commits</summary> <dl> <dd> <br> Reviewing files that changed from the base of the PR and between 1f27e2abfa57f61c340873e878664664142fc5e9 and 9f73b6670c29e37ddccba41a29ac3fd1040c463e. </dd> </dl> </details> <details> <summary><picture><source media="(prefers-color-scheme: dark)" srcset="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner-dark.svg"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-comment-icons-v1/file-plus-corner.svg" width="16" height="16" align="absmiddle" alt=""></picture> Files selected for processing: 10</summary> <dl> <dd> <br> * `core/libs/prx/libSceAgcDriver/Graphics/include/State.hpp` * `core/libs/prx/libSceAgcDriver/Graphics/src/DccMetadata.cpp` * `core/libs/prx/libSceAgcDriver/Graphics/src/Draw.cpp` * `core/libs/prx/libSceAgcDriver/Graphics/src/State.cpp` * `core/libs/prx/libSceAgcDriver/tests/Graphics.cpp` * `core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_packed_unorm4444_dcc_target_tests.cmake` * `core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444ColorTarget.cpp` * `core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444DccTarget.cpp` * `core/libs/prx/libSceAgcDriver/tests/execution/PackedUnorm4444PartialWrite.cpp` * `docs/dev/debt/changes/agc-dcc-4444-color-targets.md` </dd> </dl> </details> **Included review availability:** This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. </dd> </dl> </details> </h6> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=0d36fb46-8755-4e89-a8e3-400f5b51f2e0 attempt=7e2032b5-758d-4f6b-8a67-47070a2d73e8 batch=1/1 -->
Plyxen commented 2026-12-03 06:05:16 +00:00 (Migrated from github.com)

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

Review: APPROVED


I read the diff at 9f73b6670c. 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_packed_unorm4444_dcc_target, the other two packed_unorm4444 tests 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): packed_unorm4444_color_target and _partial_write fail on both GPUs ("unsupported color format 19 number type 0 component swap 1"); the DCC test doesn't compile without ColorTargetDccClearFormat.

The tree also had #28350, which builds on this.

Not checked: a title.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6164493811 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28311#pullrequestreview-6164493811). Originally posted by [Plyxen](https://github.com/Plyxen) on 2026-12-03T06:05:16Z. **Review:** APPROVED --- I read the diff at `9f73b6670c`. 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_packed_unorm4444_dcc_target`, the other two `packed_unorm4444` tests 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): `packed_unorm4444_color_target` and `_partial_write` fail on both GPUs ("unsupported color format 19 number type 0 component swap 1"); the DCC test doesn't compile without `ColorTargetDccClearFormat`. The tree also had #28350, which builds on this. Not checked: a title. AI-assisted: yes (Claude Code)
ligmaSec commented 2026-12-03 20:11:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T20:11:55Z.

Review: COMMENTED


PendingKeyFillTests reports success when the device cannot record the fill, and the second component-order set is skipped as well after the first such case. Could the pending-key case have its own CTest status or report the number of GPU-fill cases that executed? The current result proves ordinary clears and metadata passes, while a device without the fill path can show the same passing CTest status for the new ordering case.

Source review at 9f73b6670c. The head trial-merges onto d2e04ef9b3. Paired Vulkan execution is queued.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6177656491 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28311#pullrequestreview-6177656491). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T20:11:55Z. **Review:** COMMENTED --- `PendingKeyFillTests` reports success when the device cannot record the fill, and the second component-order set is skipped as well after the first such case. Could the pending-key case have its own CTest status or report the number of GPU-fill cases that executed? The current result proves ordinary clears and metadata passes, while a device without the fill path can show the same passing CTest status for the new ordering case. Source review at `9f73b6670c`. The head trial-merges onto `d2e04ef9b3`. Paired Vulkan execution is queued. 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/28311:upstream-pr/28311'
git switch 'upstream-pr/28311'

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