feat(agc): encode packed R11G11B10 float DCC fast clears #4315

Merged
JAB-dev merged 1 commit from upstream-pr/4315 into main 2026-10-13 11:10:17 +00:00
JAB-dev commented 2026-10-12 05:53:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-12T05:53:04Z.


Fast clears of a packed float color target (B10G11R11, guest format 36) are now encoded, so a texture or target that carries the four DCC clear codes keeps them instead of being read as stored.

What

LayoutFor had no DCC layout for VK_FORMAT_B10G11R11_UFLOAT_PACK32, so FillDccClear returned false and textureClearKeys dropped the keys. The format now has a layout of three float channels of 11, 11 and 10 bits (no alpha), and One() returns the value 1.0 for 10- and 11-bit floats (0x1e0 and 0x3c0). The clear codes 0000, 0001, 1110 and 1111 fill the texels with zero (0000, 0001) or RGB one (1110, 1111), identical for either alpha placement because the format has no alpha. One() now throws for a float channel width other than 10, 11, 16 or 32 instead of falling back to the 32-bit value.

Seen in PPSA21703 (Vampire Survivors). On current main its log shows, for a white fast clear of a packed float surface:
[gpu] texture 0x238120000 (format 36) has 1111 DCC keys at 0x23628d000; its texels are read as stored

Tested

Windows 11, WinLibs GCC 15.2.0 r7, Release.

  • packedFloatDccClearTests in tests/TextureFormat.cpp: every clear code and both alpha placements fill the texels with 0 or 0x781e03c0 (R in bits 0-10, G in 11-21, B in 22-31), and TextureClearKeys keeps the 1111 keys of a format 36 texture. On main the test fails with AGC graphics: packed float fast clear was not encoded.
  • Full ctest on this branch alone: 930/930.
  • Based on main at b42ef24e0; Linux not tested.

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
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4825474643 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4315). Originally posted by [JAB-dev](https://github.com/JAB-dev) on 2026-10-12T05:53:04Z. --- Fast clears of a packed float color target (B10G11R11, guest format 36) are now encoded, so a texture or target that carries the four DCC clear codes keeps them instead of being read as stored. ### What `LayoutFor` had no DCC layout for `VK_FORMAT_B10G11R11_UFLOAT_PACK32`, so `FillDccClear` returned false and `textureClearKeys` dropped the keys. The format now has a layout of three float channels of 11, 11 and 10 bits (no alpha), and `One()` returns the value 1.0 for 10- and 11-bit floats (0x1e0 and 0x3c0). The clear codes 0000, 0001, 1110 and 1111 fill the texels with zero (0000, 0001) or RGB one (1110, 1111), identical for either alpha placement because the format has no alpha. `One()` now throws for a float channel width other than 10, 11, 16 or 32 instead of falling back to the 32-bit value. Seen in PPSA21703 (Vampire Survivors). On current main its log shows, for a white fast clear of a packed float surface: `[gpu] texture 0x238120000 (format 36) has 1111 DCC keys at 0x23628d000; its texels are read as stored` ### Tested Windows 11, WinLibs GCC 15.2.0 r7, Release. - `packedFloatDccClearTests` in `tests/TextureFormat.cpp`: every clear code and both alpha placements fill the texels with 0 or 0x781e03c0 (R in bits 0-10, G in 11-21, B in 22-31), and `TextureClearKeys` keeps the 1111 keys of a format 36 texture. On main the test fails with `AGC graphics: packed float fast clear was not encoded`. - Full ctest on this branch alone: 930/930. - Based on main at b42ef24e0; Linux not tested. ### 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](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] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
oneandonlydean commented 2026-10-13 11:10:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T11:10:14Z.


Rebased onto main 77b9f7270c and force-pushed. The conflict in tests/TextureFormat.cpp was main's new singleDccKeysTests; both test functions now run. No code changes; the commit keeps your authorship. 0x3c0 and 0x1e0 are 1.0 as 11- and 10-bit floats, and radv's gfx8_get_fast_clear_parameters gives B10G11R11_UFLOAT_PACK32 no alpha channel and clears it to 0.0/1.0 with 0000/1111, which matches. agc_driver_graphics fails on main with packed float fast clear was not encoded and passes here, as do the DCC tests and the agc_/guest_ ctest set (Linux). Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6144228364 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4315#issuecomment-6144228364). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T11:10:14Z. --- Rebased onto main 77b9f7270c and force-pushed. The conflict in `tests/TextureFormat.cpp` was main's new `singleDccKeysTests`; both test functions now run. No code changes; the commit keeps your authorship. 0x3c0 and 0x1e0 are 1.0 as 11- and 10-bit floats, and radv's `gfx8_get_fast_clear_parameters` gives `B10G11R11_UFLOAT_PACK32` no alpha channel and clears it to 0.0/1.0 with 0000/1111, which matches. `agc_driver_graphics` fails on main with `packed float fast clear was not encoded` and passes here, as do the DCC tests and the `agc_`/`guest_` ctest set (Linux). Merging.
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!4315
No description provided.