Skip to content

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

Open
hugodearaujo wants to merge 1 commit into
boykopovar:mainfrom
hugodearaujo:fix/agc-cube-extra-slices
Open

hugodearaujo wants to merge 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 L130-131
PR 6457 docs/dev/debt/libSceAgcDriver.md L130-131
PR 6479 docs/dev/debt/libSceAgcDriver.md L130-131
PR 6730 docs/dev/debt/libSceAgcDriver.md L130-131

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 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 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 6218 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6249 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6292 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6300 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 6612 docs/dev/debt/libSceAgcDriver.md
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6636 docs/dev/debt/libSceAgcDriver.md
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 6741 docs/dev/debt/libSceAgcDriver.md
PR 6747 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 6762 docs/dev/debt/libSceAgcDriver.md
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 6941 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 6958 core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6960 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6966 docs/dev/debt/libSceAgcDriver.md
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 7008 docs/dev/debt/libSceAgcDriver.md
PR 7048 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
PR 7254 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 7258 core/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cpp
core/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.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 7390 docs/dev/debt/libSceAgcDriver.md
PR 7432 docs/dev/debt/libSceAgcDriver.md
PR 7446 docs/dev/debt/libSceAgcDriver.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
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 7642 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
core/libs/prx/libSceAgcDriver/tests/Recorder.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7659 docs/dev/debt/libSceAgcDriver.md
PR 7683 docs/dev/debt/libSceAgcDriver.md
PR 7729 docs/dev/debt/libSceAgcDriver.md
PR 7800 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7803 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

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.

This branch has not been deployed

No deployments
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.

3 participants