Skip to content

fix(agc): accept 2D-array image loads and stores on 3D T#s - #5555

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
MidnightApora:fix/agc-2d-array-volume
Oct 14, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
MidnightApora:fix/agc-2d-array-volume

Conversation

@MidnightApora

@MidnightApora MidnightApora commented Oct 13, 2026 •

Copy link
Copy Markdown

What

A 2D-array image_load or image_store bound to a 3D T# addresses the slice as z on the hardware, but the recompiler refused it with "image descriptor is incompatible with the static runtime image interface". This adds a 3D runtime mode for 2D-array loads (as Dim2D loads already have) and for plain 2D-array stores (no atomics, no dynamic storage mips). Loads and stores whose slice is at or past the volume depth return zero / are dropped, since robust image access is not enabled.

Touches the same RuntimeImageModes condition as #5461 (biased 2D sampling of single-level volumes), which is a different access; whichever lands second needs a trivial rebase.

Tested

Windows 11 Pro (build 26200), MinGW-w64 GCC 16.2.0, NVIDIA GeForce RTX 3070 Ti (driver 32.0.16.1074), on main 8d98e88.

Passing: agc_shader_memory_tests (new verifyVolumeArrayLoadMode, using the title's T#s), agc_driver_image_address_dimension_tests (new 2D-array load on a 2-slice volume), agc_driver_image_store_array_through_volume_tests (new: 2D-array store into a 4x4x2 volume plus a dropped out-of-range slice), agc_driver_image_store_line_through_plane_tests, agc_driver_image_volume_address_on_plane_tests, agc_driver_image_volume_address_planar_texture_tests, agc_driver_image_plane_address_on_line_tests.

MARVEL Cosmic Invasion (PPSA29629) aborted on its first presentation with [videoout] presentation failed: compute shader ...: image descriptor is incompatible with the static runtime image interface: descriptor format 20 decodes to {class 2, dim 4, ...}; T# 02466600 01400000 00000000 a0500204 00000001 00700000 00000000 00000000 (and a second store T# 02466300 ...). With this PR it gets past that point and stops later on an unrelated direct memory error.

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
  • Unblocks: PPSA29629 (Game bring-up discussion to follow)
  • GPUs tested: NVIDIA GeForce RTX 3070 Ti, driver 32.0.16.1074, Windows 11 Pro 26200
  • AI-assisted: yes

A 2D-array image_load or image_store bound to a 3D T# addresses the slice as z. Add a 3D runtime mode for these accesses and drop loads and stores whose slice is past the volume depth.
@MarcZX10

Copy link
Copy Markdown
Contributor

The current conventions run fails on the PR body: it reports the What, Tested, and Checklist sections as missing or empty. The check parses the template headings (### What, ### Tested, ### Checklist), so the current What: / Tested: text is not recognized even though it contains the information. Could you move the existing details into those three headings and fill the checklist items?

AI-assisted: yes; reviewed by MarcZX100.

@MidnightApora

Copy link
Copy Markdown
Author

The current conventions run fails on the PR body: it reports the What, Tested, and Checklist sections as missing or empty. The check parses the template headings (### What, ### Tested, ### Checklist), so the current What: / Tested: text is not recognized even though it contains the information. Could you move the existing details into those three headings and fill the checklist items?

AI-assisted: yes; reviewed by MarcZX100.

Thanks, moved everything under the template headings and filled in the checklist. Also rebased onto current main.

@MarcZX10

Copy link
Copy Markdown
Contributor

Thanks for updating the body. I confirm the new conventions run passes on the published head.

AI-assisted: yes; reviewed by MarcZX100.

@xXPBSXx

xXPBSXx commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Title evidence for this PR (Windows 10, NVIDIA GeForce RTX 4080 SUPER, one run each, no picture checked): Kena: Bridge of Spirits (PPSA01746). On main 2ba3147ac with #5479 (head aec5ba133) the title stops after about 84 s with [videoout] presentation failed: image descriptor is incompatible with the static runtime image interface: descriptor format 56 decodes to {class 1, dim 4, ...}; modes: {class 1, dim 3, ...} ...; the T# in the message is 20066b00 03800000 00000000 a0500f2e, a 3D T# read through a 2D array interface, the case this PR addresses (log run_044057.err). On main a21d73733 with #5479 and this PR (head 945b97094) one run of about 8 minutes ended without that error: no terminate and no what() line in the log (128 lines, run_045307.err). Not checked: the rendered picture, a control run on that main with #5479 only, other titles.

AI-assisted (Claude Code).

@xXPBSXx

xXPBSXx commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Windows test of #5555: Windows 10 (19045), MinGW-w64 GCC 15.2, Release, ninja -j 4, ctest called directly; ctest ran without -V, so the logs of the passing runs do not show which GPU, if any, the tests used (not verified). Tree: main dd7174423 + merge of PR head 945b97094c9a06e9f94063727fb93ff7bba03525 (local merge 4d3d7e7f1, no conflict). Logs: rtx5555_*_N.log, rtx5555_result.txt.
4 ctest targets, 3 runs each, exit code 0 in 12 of 12 runs: agc_driver_image_address_dimension, agc_driver_image_store_array_through_volume, agc_shader_bindless, agc_shader_memory.
Not tested: that the new or changed tests fail without the change (no baseline run), other ctest targets, the AMD GPU unless named above, Linux, a title run.

AI-assisted (Claude Code).

@oneandonlydean oneandonlydean self-assigned this Oct 14, 2026
@simonbronk

Copy link
Copy Markdown
Contributor

AMD and NVIDIA runs for this PR at head 945b97094. Windows 11 Pro 26200, WinLibs GCC 15.2.0 (MinGW-w64), Release, one machine with two GPUs, each picked with ANYPS5_GPU:

  • NVIDIA GeForce RTX 5070, driver 617.42 (32.0.16.1742)
  • AMD Radeon(TM) Graphics, Ryzen integrated, gfx1036 (1002:13c0, RDNA 2), driver 32.0.21036.18

ctest -R "agc|shader|video_out" -j 8 (503 tests, including the ones this PR adds or changes):

No title run. AI-assisted: yes (Claude Code ran the builds and tests).

@oneandonlydean
oneandonlydean merged commit 9d81b4f into boykopovar:main Oct 14, 2026
2 of 3 checks passed
@simonbronk

Copy link
Copy Markdown
Contributor

This also unblocks Onimusha: Way of the Sword (PPSA27836, #5769). After its checkerboard draws (#5861, #5907), a program read a 3D T# (descriptor format 56 decodes to {class 1, dim 4, ...}) where it declares a 2D-array image, and presentation failed with the same "incompatible with the static runtime image interface" message. With the commit from this PR cherry-picked onto my local branch, that draw goes through. The title presents its health warning and then the initial settings screen (language selection), at about 15 FPS, on Windows 11 with the RTX 5070.

AI-assisted (Claude Code).

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

Labels

agc libSceAgc* shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants