Skip to content

fix(agc): decode cube descriptors with slices past their last whole cube - #7533

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
hugodearaujo:fix/agc-cube-extra-slices
Oct 20, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
hugodearaujo:fix/agc-cube-extra-slices

Conversation

@hugodearaujo

@hugodearaujo hugodearaujo commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

What

A cube texture descriptor whose range, BASE_ARRAY to DEPTH, holds six slices or more but not a whole number of cubes threw (does not contain a multiple of 6 array slices). It now decodes with every slice of that range, and the views a sampled texture is made of (the snapshot of guest memory, the view of a storage image, and its depth and repacked copies) hold them all.

  • Loads: in fix(agc): decode implicit six-face cube extents #1308, loads through a partial cube range were measured on RDNA2 to stop at DEPTH, so the slices past the last whole cube are kept.
  • Sampling: a whole cube still reads its six faces. Sampling the cube that the range cuts short is out-of-range cube-array sampling, which the technical debt already lists as unimplemented.
  • Ranges of fewer than six slices still throw.

Title

Assassin's Creed Mirage (PPSA13960, 01.007.000), with #6343 and #7532 applied, binds this cube to compute shader 0x1000b28c00: R32_FLOAT, 128x128, SW_64KB_S, BASE_ARRAY 0, DEPTH 6.

10e88300 c1600000 001fc01f b0900204 00000006 00700000 00000000 00000000

The shader samples it once (image_sample_lz with dim:SQ_RSRC_IMG_CUBE), taking the face from v_cubeid with no array index, so it reads faces 0 to 5 of the first cube. It writes the result to slice s12 (its z group) of a six-slice R8 2D array.

On main the dispatch throws:

AGC graphics: guest cube texture descriptor does not contain a multiple of 6 array slices (format 22, 128x128x7, type 11, tile 9, mips 0..0 of 1) (base array 0)

Runs on main 0d078f75d with only libSceAgcDriver.prx differing, both with the title's shaders compiled by an earlier run:

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 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: PPSA13960 Assassin's Creed Mirage (PPSA13960) #7534
  • GPUs tested: AMD Radeon RX 9070 XT, RADV (Mesa 26.2.4), Arch Linux; by testers on Windows 11: Intel UHD Graphics 770 and AMD Radeon RX 9070 XT (@savvaniss), NVIDIA GeForce RTX 4090 (@MaxLikesCode)
  • AI-assisted: yes

🤖 Generated with Claude Code

@github-actions

github-actions Bot commented Oct 18, 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 5372 docs/dev/debt/libSceAgcDriver.md L140-141

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 1368 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 4449 docs/dev/debt/libSceAgcDriver.md
PR 5021 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5499 docs/dev/debt/libSceAgcDriver.md
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5925 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6146 docs/dev/debt/libSceAgcDriver.md
PR 6185 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6187 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6194 docs/dev/debt/libSceAgcDriver.md
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6209 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6273 docs/dev/debt/libSceAgcDriver.md
PR 6280 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6412 docs/dev/debt/libSceAgcDriver.md
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6498 docs/dev/debt/libSceAgcDriver.md
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6548 docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6636 docs/dev/debt/libSceAgcDriver.md
PR 6682 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6683 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6727 docs/dev/debt/libSceAgcDriver.md
PR 6747 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6808 docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6926 docs/dev/debt/libSceAgcDriver.md
PR 6946 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6947 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6960 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6970 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6971 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7002 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7048 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7085 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7332 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7446 docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7457 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7505 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7514 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7604 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7618 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7668 docs/dev/debt/libSceAgcDriver.md
PR 7862 docs/dev/debt/libSceAgcDriver.md
PR 7927 docs/dev/debt/libSceAgcDriver.md
PR 7948 core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp
core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp
docs/dev/debt/libSceAgcDriver.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8099 docs/dev/debt/libSceAgcDriver.md
PR 8145 docs/dev/debt/libSceAgcDriver.md
PR 8223 docs/dev/debt/libSceAgcDriver.md

@savvaniss

Copy link
Copy Markdown
Contributor

Intel and AMD Windows data: with this PR the 68 tests from tests/Recorder.cpp and tests/GuestTextureResource.cpp pass on an Intel UHD 770 and an AMD RX 9070 XT. Without it, agc_driver_graphics fails on both.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, with VkCache emptied first. This head bfcb8fcdf merged into main f3059421f. "Without" means this PR's test files on main f3059421f, with none of its other changes.

Tests, ×3 UHD 770 RX 9070 XT
This head: 68 tests 61 pass, 7 import-settle tests skip (no other queue family to settle imports on) 68 of 68 pass
Without agc_driver_graphics fails: guest cube texture descriptor does not contain a multiple of 6 array slices (format 56, 32x32x7, type 11, tile 0, mips 0..0 of 1) (base array 0) same

I also ran full CTest with this PR and the 14 other open AGC PRs I tested in the same batch merged together (#7647, #7641, #7630, #7627, #7603, #7600, #7591, #7579, #7535, #7474, #7462, #7050, #7048, #7650). Neither GPU showed a failure beyond main's own, except #7650's new test.

AI-assisted: yes (Claude Code)

@hugodearaujo

Copy link
Copy Markdown
Contributor Author

@savvaniss Thanks, that's the cross-vendor data this needed, and the without-PR run is a good control. I added it to the Tested section.

@MaxLikesCode

Copy link
Copy Markdown
Contributor

NVIDIA data to go with the AMD and Intel runs: GeForce RTX 4090, driver 617.42, Windows 11 Pro 26200, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON with every execution test built. This head (bfcb8fc) merged into main ad502d7.

AI-assisted: yes (Claude Code)

@hugodearaujo

Copy link
Copy Markdown
Contributor Author

@MaxLikesCode Thanks, that adds the NVIDIA run this PR was missing. I added it to the Tested section.

@adriadam10 adriadam10 self-assigned this Oct 19, 2026
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
# Conflicts:
#	docs/dev/debt/libSceAgcDriver.md
@hugodearaujo
hugodearaujo force-pushed the fix/agc-cube-extra-slices branch from bfcb8fc to 086e98a Compare October 20, 2026 02:16
@hugodearaujo

Copy link
Copy Markdown
Contributor Author

Rebased onto main 713ee69. The only conflict was the TechnicalDebt line next to the cube entry, changed by #6730; the code is unchanged.

Linux (Arch, kernel 7.2.11, GCC 16.2.1, Release, RX 9070 XT with RADV, Mesa 26.2.5): full CTest 1655 of 1659, agc_driver_graphics passes; the four failures also fail on main here: agc_driver_tessellation (#5444), agc_driver_bda_device (#7584), agc_driver_image_table_vouched_lookups (#7766) and agc_driver_guest_memory_lifetime (#7784).

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 20, 2026
@adriadam10
adriadam10 merged commit d2d9b10 into boykopovar:main Oct 20, 2026
10 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the diff: the cube decode keeps every slice up to DEPTH (the bound loads use on hardware, measured in #1308), ranges under six slices still throw, and the four sampled views (snapshot, storage, depth copy, repacked copy) are 2D-array views, so the layer count doesn't need to be a multiple of 6. The decode test and the recorder cube test fail on main; the Windows AMD, Intel and NVIDIA runs cover the GPU side. The sRGB-expand view still throws for such cubes, which is fine (exact or throw). Merged.

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

Labels

agc libSceAgc* docs unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants