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

Merged
MidnightApora merged 1 commit from upstream-pr/5555 into main 2026-10-14 10:57:52 +00:00
MidnightApora commented 2026-10-13 23:48:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MidnightApora on 2026-10-13T23:48:32Z.


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 8d98e8851.

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
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4850928854 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5555). Originally posted by [MidnightApora](https://github.com/MidnightApora) on 2026-10-13T23:48:32Z. --- ### 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` 8d98e8851. 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 - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA29629 (Game bring-up discussion to follow) - [x] GPUs tested: NVIDIA GeForce RTX 3070 Ti, driver 32.0.16.1074, Windows 11 Pro 26200 - [x] AI-assisted: yes
MarcZX10 commented 2026-10-13 23:54:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T23:54:44Z.


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157698009 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5555#issuecomment-6157698009). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T23:54:44Z. --- 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 commented 2026-10-14 00:03:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MidnightApora on 2026-10-14T00:03:06Z.


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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157799634 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5555#issuecomment-6157799634). Originally posted by [MidnightApora](https://github.com/MidnightApora) on 2026-10-14T00:03:06Z. --- > 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 commented 2026-10-14 00:04:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T00:04:10Z.


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

AI-assisted: yes; reviewed by MarcZX100.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157813104 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5555#issuecomment-6157813104). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-14T00:04:10Z. --- Thanks for updating the body. I confirm the new conventions run passes on the published head. AI-assisted: yes; reviewed by MarcZX100.
xXPBSXx commented 2026-10-14 03:05:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T03:05:47Z.


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).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6159961203 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5555#issuecomment-6159961203). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T03:05:47Z. --- 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 commented 2026-10-14 03:23:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T03:23:06Z.


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).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6160158101 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5555#issuecomment-6160158101). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T03:23:06Z. --- 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).
simonbronk commented 2026-10-14 08:59:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T08:59:33Z.


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):

  • RTX 5070: all 503 pass.
  • AMD gfx1036: all pass except agc_driver_lds_mixed_width_atomics, agc_driver_pixel_interlock and agc_driver_layered_volume_vertex_no_gpl. These three fail the same way on current main (872f52320) on this GPU and pass there on the RTX 5070; they are the three of #5271, so not caused by this PR.

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

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6164727881 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5555#issuecomment-6164727881). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T08:59:33Z. --- 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): - RTX 5070: all 503 pass. - AMD gfx1036: all pass except `agc_driver_lds_mixed_width_atomics`, `agc_driver_pixel_interlock` and `agc_driver_layered_volume_vertex_no_gpl`. These three fail the same way on current `main` (`872f52320`) on this GPU and pass there on the RTX 5070; they are the three of #5271, so not caused by this PR. No title run. AI-assisted: yes (Claude Code ran the builds and tests).
simonbronk commented 2026-10-14 15:40:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T15:40:44Z.


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).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6172182999 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5555#issuecomment-6172182999). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T15:40:44Z. --- 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 in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!5555
No description provided.