Skip to content

feat(agc): support thick 4 KiB standard XOR volumes - #7294

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Amoenus:codex/feat-thick-s4kb-x-main64df
Oct 17, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Amoenus:codex/feat-thick-s4kb-x-main64df

Conversation

@Amoenus

@Amoenus Amoenus commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

What

Support thick 3D SW_4KB_S_X surfaces (swizzle 21) for 1, 2, 4, 8 and 16-byte elements. Use the 4 KiB thick block geometry and a separate 3D equation in the existing GPU detile/retile pipeline. Other unsupported thick modes continue to throw.

Sonic Unleashed Recompiled PPSA99902, #4443 / #7260, requests a 128x128x8, two-level, RGBA8_UINT, SW_4KB_S_X color target after its opening movie. The ordinary composed-title run stops at:

AGC graphics: mipmapped 3D color targets are unsupported

The behavior-preserving diagnostic in #7260 captured its register words. This PR supplies the missing layout prerequisite; the volume-mip decoder/view fix is the dependent #7310. Main's geometry/load tests currently stop at:

AGC graphics: thick 3D textures are only supported in SW_4KB_S, SW_64KB_S, SW_64KB_S_X and SW_64KB_D_X, not in swizzle mode 21 at 4 bytes per element

Equations come from AMD PAL c5e80007, GetSwizzlePatternInfo, selecting GFX10_SW_4K_S3_X_PATINFO in the GFX10 pattern tables, non-RB+ Navi1x with 16 pipes. Console equivalence remains unmeasured and is recorded in technical debt.

Overlap: #6977 wraps the same dispatcher branch for GCN. It implements different behavior; the adjacent hunk needs merge-order coordination. Discussion. Proposed order is this small layout addition first, then retaining its map entry in #6977's thick branch. #7258's sampled-array windows are also distinct. No foreign commits are included.

Tested

Head b2d9880700fef64c1d5df394f6afa80d8b8ca558, main b4f05ab328fac5a9c1c458398e55f7ab3bfe8508.

  • Full Release relinker and system-library builds pass on Windows (WinLibs GCC15.2) and Ubuntu24.04.
  • agc_driver_graphics, agc_driver_image_xor_swizzle_volume and agc_driver_layered_volume_vertex pass on both physical GPUs and lavapipe. Shader disk cache and pipeline journal disabled. Windows Khronos1.4.363 loading confirmed; no observed VUIDs. Linux validation layer unavailable, so no Linux validation-layer claim.
  • New golden address and load controls fail on main64df's unchanged missing-layout guard and pass with this change; the relevant production functions are unchanged between that baseline and mainb4. GPU draw/writeback checks every selected band and the untouched depth slice. CPU controls cover all five element sizes, packed tails, nonzero pipe/bank XOR, BC block geometry, and the title's 128x128x8/two-level extent. Physical GPU tests use 4-byte elements.
  • An external compiled comparison of the production geometry/equations against AMD's independent Addr2ComputeSurfaceInfo / Addr2ComputeSurfaceAddrFromCoord passes 20 surfaces / 82,240 addresses. The table derivation also reproduces all20 existing thick equations. This is a public-source oracle, not console measurement.
  • The same focused groups passed three repeated fresh-process runs per vendor on earlier maince0; current-head runs above passed3/3 per group on each of NVIDIA, AMD and lavapipe after the mainb4 rebase (27 processes total, including CPU checks). No selected skips or timeouts. The six changed layout/fixture source files are byte-identical to the previous ca9 head. Cppcheck/clang-tidy completed on the five changed C++ translation units before the rebase: no selected clang-tidy findings; three existing Cppcheck guarded-null warnings were manually checked against throwing Require guards. Conventions pass.
  • Additional historical AMD no-GPL control fails in the old R64 draw before this new case and reproduces with unchanged main production. No whole-suite, FPS, gameplay or completed Sonic-fix claim. The title evidence in AGC: mipmapped 3D color targets stop PPSA99902 after the opening movie #7260 uses its explicitly listed bring-up composition and original conversion, not unchanged-main startup.

Reproduce the focused checks after the standard full build:

ctest --test-dir build -R '^agc_driver_(graphics|image_xor_swizzle_volume|layered_volume_vertex)$' --output-on-failure

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: PPSA99902 Sonic Unleashed Recompiled (PPSA99902): initial gameplay on fork and remaining work #4443 (layout prerequisite for AGC: mipmapped 3D color targets stop PPSA99902 after the opening movie #7260; volume-mip decoding remains separate)
  • GPUs tested: NVIDIA GeForce RTX5080, driver32.0.16.1062, Windows11 Enterprise26200; AMD Radeon(TM) Graphics (1002:13c0), driver32.0.21036.18, Windows11 Enterprise26200; Mesa llvmpipe LLVM20.1.2, Mesa25.2.8, Ubuntu24.04 under WSL2
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6959 docs/dev/debt/libSceAgcDriver.md L175
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp L144-148

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4650 docs/dev/debt/libSceAgcDriver.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5499 core/libs/prx/libSceAgcDriver/Graphics/src/TextureDetiler.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5925 docs/dev/debt/libSceAgcDriver.md
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6222 docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6243 docs/dev/debt/libSceAgcDriver.md
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6454 docs/dev/debt/libSceAgcDriver.md
PR 6457 docs/dev/debt/libSceAgcDriver.md
PR 6479 docs/dev/debt/libSceAgcDriver.md
PR 6481 docs/dev/debt/libSceAgcDriver.md
PR 6492 docs/dev/debt/libSceAgcDriver.md
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6563 docs/dev/debt/libSceAgcDriver.md
PR 6636 docs/dev/debt/libSceAgcDriver.md
PR 6678 docs/dev/debt/libSceAgcDriver.md
PR 6727 docs/dev/debt/libSceAgcDriver.md
PR 6730 docs/dev/debt/libSceAgcDriver.md
PR 6741 docs/dev/debt/libSceAgcDriver.md
PR 6783 docs/dev/debt/libSceAgcDriver.md
PR 6786 docs/dev/debt/libSceAgcDriver.md
PR 6804 docs/dev/debt/libSceAgcDriver.md
PR 6808 docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6946 docs/dev/debt/libSceAgcDriver.md
PR 6947 docs/dev/debt/libSceAgcDriver.md
PR 7089 docs/dev/debt/libSceAgcDriver.md
PR 7154 docs/dev/debt/libSceAgcDriver.md
PR 7175 docs/dev/debt/libSceAgcDriver.md
PR 7178 docs/dev/debt/libSceAgcDriver.md
PR 7258 core/libs/prx/libSceAgcDriver/Graphics/src/TextureTiling.cpp
core/libs/prx/libSceAgcDriver/tests/TextureTiling.cpp
docs/dev/debt/libSceAgcDriver.md

@MarcZX10

Copy link
Copy Markdown
Contributor

I finished a separate follow-up for #7260 that decodes mipmapped 3D color views using this PR’s thick layout, validates the selected mip’s depth slices, and adds the 128×128×8 two-mip S4KBX decoder regression. The local AGC graphics validation suite passed; this host required a temporary compiler workaround for an unrelated GCC template parse error and bypassing the PS5 CPU capability guard for the mock test binary.

I kept the implementation in its own commit/branch. Since the prerequisite is still open, I’ll open the follow-up once this PR merges so the published diff contains only the decoder work and doesn’t duplicate your layout changes.

@MarcZX10

Copy link
Copy Markdown
Contributor

Update on the decoder follow-up: your current head b2d9880700fef64c1d5df394f6afa80d8b8ca558 is now the base of my integration check. The follow-up cherry-picks cleanly onto it, and the full agc_driver_graphics_tests executable passes on the combined tree, including the positive 3D mip-view regression replacing #7274's diagnostic-only assertion. Local validation still required the same temporary workaround for an unrelated GCC template parse error and the PS5 CPU guard; neither workaround is in either PR.

@Amoenus

Amoenus commented Oct 17, 2026

Copy link
Copy Markdown
Contributor Author

@MarcZX100 Thank you for the independent decoder work and #7274 diagnostic. I missed these follow-up comments before opening #7310; sorry for the crossed effort. Our decoder/view fix was already tracked on the fork in #7260, and #7310 now submits it with #7294 explicitly declared as its prerequisite.

It includes selected-mip/depth1 handling, explicit DCC/CMASK refusals, the converted diagnostic fixture, and ten GPU draw/readback cases, passing3/3 on RTX5080, AMD Radeon Graphics and lavapipe. Could you link your focused commit so we can compare the implementations and retain attribution for any corrections? I would like to combine useful work and avoid a second overlapping submission. The new title replay stopped at HTILE completion; it does not yet prove a successful volume bind. Exact scope is maintained in #7260/#7310.

AI-assisted: Codex; author responsible.

@oneandonlydean
oneandonlydean merged commit bd58561 into boykopovar:main Oct 17, 2026
10 checks passed
@MarcZX10

Copy link
Copy Markdown
Contributor

I pushed my one-commit decoder branch for comparison: 585a58d, based on b4f05ab32.

Comparing it with #7310, your implementation is broader and covers gaps in my draft: it preserves 3D identity at depth 1, routes volume mip layouts through DescribeSurface, explicitly refuses mipmapped DCC/CMASK, and checks slice windows without overflow-prone addition. It also has substantially wider tile-mode and GPU draw/readback coverage. My draft has no unique correction that I think should be carried; #7310 supersedes it, so I will not open a duplicate PR. Please use your implementation and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants