feat(agc): detile the display, T and 4 KiB XOR swizzle modes #935

Merged
CnRJay merged 2 commits from upstream-pr/935 into main 2026-10-07 21:27:46 +00:00
CnRJay commented 2026-10-06 18:47:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-06T18:47:04Z.


What

Textures in SW_256B_D, SW_4KB_D, SW_64KB_D, SW_64KB_S_T, SW_64KB_D_T, SW_4KB_S_X and SW_4KB_D_X (tile modes 2, 6, 10, 17, 18, 21 and 22) threw while their T# was decoded.

  • They are detiled with address equations generated from AMD addrlib's GFX10 swizzle patterns. These use the same 16-pipe non-RB+ configuration as the existing 64 KiB XOR table.
  • Each mode shares the block shape and mip tail placement of the standard mode with the same block size.
  • The pipe/bank XOR base check of the XOR and T modes now uses the block size.

Tested

Windows 11, MinGW GCC Release build, ctest agc_driver_graphics passes.

  • tests/GuestTextureResource.cpp: each of the 7 tile modes decodes to its swizzle. A 4 KiB XOR mode accepts a 4 KiB-aligned base, and the 4 KiB XOR and 64 KiB T modes reject a base that breaks the pipe/bank XOR check.
  • tests/TextureTiling.cpp: element addresses over several mip levels match addrlib output.
  • tests/TextureDetiler.cpp: SW_4KB_D_X detiling selects the equation path over 4 KiB blocks.

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:4763206851 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/935). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-06T18:47:04Z. --- ### What Textures in SW_256B_D, SW_4KB_D, SW_64KB_D, SW_64KB_S_T, SW_64KB_D_T, SW_4KB_S_X and SW_4KB_D_X (tile modes 2, 6, 10, 17, 18, 21 and 22) threw while their T# was decoded. - They are detiled with address equations generated from AMD addrlib's GFX10 swizzle patterns. These use the same 16-pipe non-RB+ configuration as the existing 64 KiB XOR table. - Each mode shares the block shape and mip tail placement of the standard mode with the same block size. - The pipe/bank XOR base check of the XOR and T modes now uses the block size. ### Tested Windows 11, MinGW GCC Release build, ctest `agc_driver_graphics` passes. - `tests/GuestTextureResource.cpp`: each of the 7 tile modes decodes to its swizzle. A 4 KiB XOR mode accepts a 4 KiB-aligned base, and the 4 KiB XOR and 64 KiB T modes reject a base that breaks the pipe/bank XOR check. - `tests/TextureTiling.cpp`: element addresses over several mip levels match addrlib output. - `tests/TextureDetiler.cpp`: SW_4KB_D_X detiling selects the equation path over 4 KiB blocks. ### 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)
adriadam10 commented 2026-10-07 21:27:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T21:27:42Z.


Checked all 35 new equations (7 modes x 5 element sizes, 2x2 blocks x 3 slices) and the 7 address tables in the test against Mesa addrlib (Navi10, 16 pipes): no mismatches. Local build + ctest green; the 4 KiB XOR base check matches where these equations put the XOR bits. Merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6047196288 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/935#issuecomment-6047196288). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-07T21:27:42Z. --- Checked all 35 new equations (7 modes x 5 element sizes, 2x2 blocks x 3 slices) and the 7 address tables in the test against Mesa addrlib (Navi10, 16 pipes): no mismatches. Local build + ctest green; the 4 KiB XOR base check matches where these equations put the XOR bits. Merging once CI is green.
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!935
No description provided.