fix(agc): decode cube descriptors with slices past their last whole cube #7533
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7533"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-18T12:38:34Z.
What
A cube texture descriptor whose range,
BASE_ARRAYtoDEPTH, 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.DEPTH, so the slices past the last whole cube are kept.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_ARRAY0,DEPTH6.The shader samples it once (
image_sample_lzwithdim:SQ_RSRC_IMG_CUBE), taking the face fromv_cubeidwith no array index, so it reads faces 0 to 5 of the first cube. It writes the result to slices12(its z group) of a six-slice R8 2D array.On
mainthe dispatch throws:Runs on
main0d078f75dwith onlylibSceAgcDriver.prxdiffering, both with the title's shaders compiled by an earlier run:main: that error.This PR: past it, then the next unimplemented path. #6973, #6987, #6989, #6995 and #7002 change that path.
Tested
agc_driver_graphics: a cube descriptor withBASE_ARRAY0 andDEPTH6 decodes with seven slices, and its surface holds them.DEPTH4 still throws. It fails onmain.agc_driver_recorder_tests --cube-only(RADV): 64x64 cubes with seven slices, each slice filled with its own value, are sampled at every slice through the four views: the snapshot and the storage view of an R8 cube, the depth copy of an R32_FLOAT cube and the repacked copy of a format 43 cube. It fails onmainwith the error above, and with the check of the depth or the repacked copy as onmainit fails at that copy.-j8, 1437 of 1438 pass.agc_driver_tessellationsegfaults the same way without this PR.BUILD_TESTING=ON, no GPU: full CTest, no failures out of 1478;agc_driver_gated_dispatch_capture_short_timeoutis skipped there.mainf3059421f. The 68 tests fromtests/Recorder.cppandtests/GuestTextureResource.cpppass on the RX 9070 XT, and 61 pass with 7 import-settle tests skipped on the UHD 770; with only this PR's test files onmain,agc_driver_graphicsfails on both with the 7-slice cube refusal.mainad502d717.agc_driver_recorder_tests --cube-onlypasses 3 of 3, andagc_driver_graphicsand the cube teststools/select_tests.pyreaches pass; of the 975 tests it selects, 957 pass, 15 skip and 3 fail, the same 3 that fail onmainon that GPU (#7584, #7710, #7708).tools/check_conventions.pypasses.tools/pr_overlap.pylists #6457, #6479 and #6730: they change the technical debt entry on the line above the cube entry, so a merge with any of them conflicts on those two adjacent lines ofdocs/dev/debt/libSceAgcDriver.md. No code overlaps.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-18T12:48:41Z.
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.
main)docs/dev/debt/libSceAgcDriver.mdL140-141Some 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.
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Recorder.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/Texture.cppcore/libs/prx/libSceAgcDriver/tests/Recorder.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/Graphics/src/GuestTextureResource.cppcore/libs/prx/libSceAgcDriver/tests/GuestTextureResource.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdImported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-18T21:53:11Z.
Intel and AMD Windows data: with this PR the 68 tests from
tests/Recorder.cppandtests/GuestTextureResource.cpppass on an Intel UHD 770 and an AMD RX 9070 XT. Without it,agc_driver_graphicsfails 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, withVkCacheemptied first. This headbfcb8fcdfmerged intomainf3059421f. "Without" means this PR's test files onmainf3059421f, with none of its other changes.agc_driver_graphicsfails: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)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)
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-18T21:56:35Z.
@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.
Imported from boykopovar/AnyPS5. Originally posted by MaxLikesCode on 2026-10-19T02:47:13Z.
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=ONwith every execution test built. This head (bfcb8fcdf) merged intomainad502d717.agc_driver_recorder_tests --cube-only, run by hand withANYPS5_NO_SHADER_CACHE=1: 3 of 3 pass (Single cube snapshot and storage sampling tests passed).agc_driver_graphicspasses, and so do the cube tests the selection reaches (agc_driver_image_sample_cube_derivatives,agc_driver_vop3_cube_clamp,agc_driver_image_plane_address_on_cube).tools/select_tests.pyselects for this change: 957 pass, 15 skip and 3 fail. The 3 failures are the onesmainhas on this GPU without this PR:agc_driver_bda_device(#7584),agc_driver_image_table_reuse(#7710) andagc_driver_pixel_lds(#7708).tools/check_skips.py --job windowsaccepts the skips.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-19T02:51:26Z.
@MaxLikesCode Thanks, that adds the NVIDIA run this PR was missing. I added it to the Tested section.
Imported from boykopovar/AnyPS5. Originally posted by hugodearaujo on 2026-10-20T02:16:45Z.
Rebased onto
main713ee693e. 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_graphicspasses; the four failures also fail onmainhere:agc_driver_tessellation(#5444),agc_driver_bda_device(#7584),agc_driver_image_table_vouched_lookups(#7766) andagc_driver_guest_memory_lifetime(#7784).Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T10:26:02Z.
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 onmain; 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.