PRAGMATA (PPSA02530): a shader with four bindless image tables and five direct images exceeds MaxImages 64 ("static bindless image capacity exceeded") #5720

Closed
opened 2026-10-14 08:01:48 +00:00 by xXPBSXx · 5 comments
xXPBSXx commented 2026-10-14 08:01:48 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-14T08:01:48Z.


What

With the table T# fixes of #5620 and #5550 applied, PRAGMATA (PPSA02530) gets past GetImageResource dword 0 is not a valid runtime value and then stops at

what():  shader 0x22687ef500 stage 5: ShaderRecompiler::Recompile: static bindless image capacity exceeded

The throw is ResourceMaterializer.cpp:870: if (images.size() + slots - 1u > ShaderInfo::MaxImages) throw ..., with RuntimeAbi::BindlessTableSlots = 16 (RuntimeAbi.hpp:39) and ShaderInfo::MaxImages = 64 (ShaderInfo.hpp:15). Each image that is loaded from a bindless table is expanded to 16 image slots.

A debug print I added locally in front of the throw (not part of any PR) gives, for the shader above:

[diag-cap] images=54 directCount=9 slots=16 maxImages=64 tablesTotal=4 currentIndex=8

So the shader has 9 static images, 4 of which are bindless tables. At image index 8 three tables are already expanded (9 + 3 x 15 = 54 image slots); the fourth would need 15 more (54 + 15 = 69 > 64). Four tables of 16 slots plus five direct images need 69 slots; the limit is 64.

Log: PPSA02530_rR/run_094530.err, line 126 ([diag-cap]) and line 129 (what():), counted with Python.

This is a design limit (slots per table, MaxImages, or sharing slots between tables), not a one-line change, so I am not proposing a fix here.

Tested

Windows 10 (19045), MinGW-w64 GCC 15.2, Release, NVIDIA GeForce RTX 4080 SUPER; one run of 300 s requested, the title ended with this throw (script times 09:45:24 to 09:47:44); run_title.ps1, one game at a time.

Tree (local merges, not pushed): main 78f1aea706e93b109da7180bf76718f545ef0e43 + #5457 (1243f067b1ead9d45b5ecda38e1f736eddca8916) + #5620 (98afd6bf2d24a32b01d11be5a303ca6d33f71230) + #5550 (cd1757e03659f4a363e1b73a2d8a3711808e084b; its conflict with #5620 in tests/ShaderMemory.cpp was resolved with -X theirs, which does not affect the libraries) + #5189 (b6bc7218fd909faddff6f1d1bf769e03292716fa) + the debug print (local commit 16abdff1a).
Libraries: ninja -j 8 libs exit code 0 (09:42:18 to 09:45:05), 128 .prx (libSceAgcDriver.prx 09:44:48, libkernel/libc 09:45:04, oldest .prx 2026-10-13 09:50, not rebuilt by ninja); nid_patcher dated 2026-10-14 08:00:09.
Local keycode stub: libSceConvertKeycode.prx replaced by a stub built locally by D (sha256 prefix B183C69D999980FC, 83053 bytes), because main at that time threw in sceConvertKeycodeGetCharacter. (#5366 has since been merged; a run without the stub is in preparation and is not part of this report.)
Title executable: PPSA02530_rR/app.exe, a hardlink of D's PPSA02530_rO/app.exe (dated 2026-10-14 07:36:44); relinker commit and relink command for it: not recorded in my notes.

Not tested: Linux, other GPUs, a second run, a different count of tables, a picture of the title.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5844181073 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5720). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-14T08:01:48Z. --- ### What With the table T# fixes of #5620 and #5550 applied, PRAGMATA (PPSA02530) gets past `GetImageResource dword 0 is not a valid runtime value` and then stops at ``` what(): shader 0x22687ef500 stage 5: ShaderRecompiler::Recompile: static bindless image capacity exceeded ``` The throw is `ResourceMaterializer.cpp:870`: `if (images.size() + slots - 1u > ShaderInfo::MaxImages) throw ...`, with `RuntimeAbi::BindlessTableSlots = 16` (`RuntimeAbi.hpp:39`) and `ShaderInfo::MaxImages = 64` (`ShaderInfo.hpp:15`). Each image that is loaded from a bindless table is expanded to 16 image slots. A debug print I added locally in front of the throw (not part of any PR) gives, for the shader above: ``` [diag-cap] images=54 directCount=9 slots=16 maxImages=64 tablesTotal=4 currentIndex=8 ``` So the shader has 9 static images, 4 of which are bindless tables. At image index 8 three tables are already expanded (9 + 3 x 15 = 54 image slots); the fourth would need 15 more (54 + 15 = 69 > 64). Four tables of 16 slots plus five direct images need 69 slots; the limit is 64. Log: `PPSA02530_rR/run_094530.err`, line 126 (`[diag-cap]`) and line 129 (`what():`), counted with Python. This is a design limit (slots per table, `MaxImages`, or sharing slots between tables), not a one-line change, so I am not proposing a fix here. ### Tested Windows 10 (19045), MinGW-w64 GCC 15.2, Release, NVIDIA GeForce RTX 4080 SUPER; one run of 300 s requested, the title ended with this throw (script times 09:45:24 to 09:47:44); `run_title.ps1`, one game at a time. Tree (local merges, not pushed): `main` `78f1aea706e93b109da7180bf76718f545ef0e43` + #5457 (`1243f067b1ead9d45b5ecda38e1f736eddca8916`) + #5620 (`98afd6bf2d24a32b01d11be5a303ca6d33f71230`) + #5550 (`cd1757e03659f4a363e1b73a2d8a3711808e084b`; its conflict with #5620 in `tests/ShaderMemory.cpp` was resolved with `-X theirs`, which does not affect the libraries) + #5189 (`b6bc7218fd909faddff6f1d1bf769e03292716fa`) + the debug print (local commit `16abdff1a`). Libraries: `ninja -j 8 libs` exit code 0 (09:42:18 to 09:45:05), 128 `.prx` (libSceAgcDriver.prx 09:44:48, libkernel/libc 09:45:04, oldest `.prx` 2026-10-13 09:50, not rebuilt by `ninja`); `nid_patcher` dated 2026-10-14 08:00:09. Local keycode stub: `libSceConvertKeycode.prx` replaced by a stub built locally by D (sha256 prefix `B183C69D999980FC`, 83053 bytes), because `main` at that time threw in `sceConvertKeycodeGetCharacter`. (#5366 has since been merged; a run without the stub is in preparation and is not part of this report.) Title executable: `PPSA02530_rR/app.exe`, a hardlink of D's `PPSA02530_rO/app.exe` (dated 2026-10-14 07:36:44); relinker commit and relink command for it: not recorded in my notes. Not tested: Linux, other GPUs, a second run, a different count of tables, a picture of the title. AI-assisted (Claude Code).
simonbronk commented 2026-10-14 10:26:30 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T10:26:30Z.


Onimusha: Way of the Sword (PPSA27836 01.000.001, also RE Engine) reaches the same throw on Windows 11, RTX 5070, with main 0b97f8b9f plus #5620 and #5550 (and the start-up fixes in #5769):

what():  shader 0x2111562a00 stage 5: ShaderRecompiler::Recompile: static bindless image capacity exceeded

#1184 (tables up to the device's sampled-image limit) targets this limit but needs a rebase onto current main; it was not tried here.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166250969 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5720#issuecomment-6166250969). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T10:26:30Z. --- Onimusha: Way of the Sword (PPSA27836 01.000.001, also RE Engine) reaches the same throw on Windows 11, RTX 5070, with `main` 0b97f8b9f plus #5620 and #5550 (and the start-up fixes in #5769): ``` what(): shader 0x2111562a00 stage 5: ShaderRecompiler::Recompile: static bindless image capacity exceeded ``` #1184 (tables up to the device's sampled-image limit) targets this limit but needs a rebase onto current `main`; it was not tried here. AI-assisted: yes (Claude Code).
simonbronk commented 2026-10-14 10:36:16 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T10:36:16Z.


Follow-up from Onimusha (PPSA27836), as data for the table redesign mentioned in #1184. As a local experiment only, raising ShaderInfo::MaxImages and RuntimeAbi::SampledHeapCapacity from 64 to 128 gets it past this throw and past shader image heap capacity exceeded. It then stops at a compute program that reads a whole table with no material records:

what():  compute shader 0x21115dde00: bindless image table has 32768 entries (0 materials), limit 16

So this title needs tables far larger than 16 slots, like the 65536-entry heap of GTA V in #1184. Not proposing the 128 change.

AI-assisted: yes (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6166418150 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5720#issuecomment-6166418150). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T10:36:16Z. --- Follow-up from Onimusha (PPSA27836), as data for the table redesign mentioned in #1184. As a local experiment only, raising `ShaderInfo::MaxImages` and `RuntimeAbi::SampledHeapCapacity` from 64 to 128 gets it past this throw and past `shader image heap capacity exceeded`. It then stops at a compute program that reads a whole table with no material records: ``` what(): compute shader 0x21115dde00: bindless image table has 32768 entries (0 materials), limit 16 ``` So this title needs tables far larger than 16 slots, like the 65536-entry heap of GTA V in #1184. Not proposing the 128 change. AI-assisted: yes (Claude Code).
nikowolf123 commented 2026-10-14 17:13:08 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by nikowolf123 on 2026-10-14T17:13:08Z.


#757 and #758 are both merged now (15:48 and 15:53 UTC, main e34c47921), and the throw in this issue is no longer on main. Before anyone ports #5620/#5820 or starts the #1184 redesign, a PRAGMATA and an Onimusha run on main would show what is still missing.

What changed on main. git grep under core/ on e34c47921 finds no resolveTableImage, IndirectImage, TryMakeTableImage, static bindless image capacity exceeded, bindless image table has ... limit, distinct keys exceed or bindless storage image tables are unsupported. Just before #757 (a453108cf), the first two throws were at ResourceMaterializer.cpp:879 and :382. A planned table image is now one info.images entry that heap placement skips (BindingAllocator.cpp:140). Its records go to the image-table binding, whose size ImageTableCapacity caps by the device's descriptor limits, not to 16 heap slots per table. So the 69-slot count in the report above no longer applies if the four tables plan as columns (TryMakeTableColumn); only a run shows whether they do. APS5_TRACE_BINDLESS and APS5_BINDLESS_MATERIAL_SCAN are gone as well; the trace is now APS5_TRACE_IMAGE_TABLE=1.

Conflicts with main e34c47921 (git merge-tree --write-tree on today's heads, not built):

PR head conflicting files
#5620 ee9506603 5: ResourceTracker.cpp, ResourceMaterializer.cpp, ControlFlowInfo.hpp, ShaderDiskCache.cpp, tests/ShaderDiskCache.cpp
#5820 727387252 the same 5 + ShaderDiskCache.hpp
#4475 e354f9a61 9 as a branch (still stacked on #758's earlier head a5c63d524); its own two commits replayed onto e34c47921: none
#1184 (draft) 5f3e66d0b 18

#5620 and #5820 change IndirectImage and TryMakeTableImage, which #757 deleted (in ControlFlowInfo.hpp the conflict is #5620's whole IndirectImage struct against nothing), so a rebase alone can't clear them. They need a port to TryMakeTableColumn, or nothing if the columns already plan these shaders. Two hints that they might, neither a title result:

  • verifyUniformTableImage requires a 48-byte record with the T# at +16 to plan as one column with stride 48 (a synthetic test).
  • @EagleBearerYS's Village run with #757 on their stack (comment) planned every table up to the title as one 32768-record column at stride 0x30, addend 0x10.

Run request. @xXPBSXx (PRAGMATA PPSA02530) and @simonbronk (Onimusha PPSA27836), could you run main e34c47921 with only the start-up fixes you need (#5776 merges cleanly on it; for Onimusha the others in #5769), without #5620, #5820 or the local MaxImages/SampledHeapCapacity 128 change, and with APS5_TRACE_IMAGE_TABLE=1? The "before" is @xXPBSXx's two PRAGMATA runs on 84b01f9cd (comment) and @simonbronk's Onimusha first screens on the pre-#757 path (comment). What would settle it:

  • whether the GetImageResource dword 0 stop on the 48-byte records comes back
  • the [image-table] shader 0x... table N lines for the shaders that stopped before
  • any image table: fault line, and the first new stop

Wolverine (@mrfelek's count) and SAROS (@JJenkx's run) also hit these removed messages, so a run on main would answer the same question there.

@MichonGoddijn231849 @simonbronk: #1184 was parked because tables expanded statically into the sampled heap (comment). #757 replaced that expansion, so the runs above should show whether the redesign offered here is still needed. @Pipodi: both bases of #4475 are in main now, and its two commits apply onto e34c47921 without textual conflicts. cc @Celegans12

AI-assisted: written with Claude Code; I checked the live threads of #757, #758, #5620, #5820, #4475, #1184, #5769, #5516, #1504 and this issue, and the cited lines at a453108cf and e34c47921. I ran git merge-tree on the fetched heads against e34c47921 and git grep on a453108cf and e34c47921. No build and no title run.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6174002315 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5720#issuecomment-6174002315). Originally posted by [nikowolf123](https://github.com/nikowolf123) on 2026-10-14T17:13:08Z. --- #757 and #758 are both merged now (15:48 and 15:53 UTC, `main` e34c47921), and the throw in this issue is no longer on `main`. Before anyone ports #5620/#5820 or starts the #1184 redesign, a PRAGMATA and an Onimusha run on `main` would show what is still missing. **What changed on `main`.** `git grep` under `core/` on e34c47921 finds no `resolveTableImage`, `IndirectImage`, `TryMakeTableImage`, `static bindless image capacity exceeded`, `bindless image table has ... limit`, `distinct keys exceed` or `bindless storage image tables are unsupported`. Just before #757 (a453108cf), the first two throws were at [ResourceMaterializer.cpp:879](https://github.com/boykopovar/AnyPS5/blob/a453108cf7768b71879b0e832d367a935c43440d/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp#L879) and [:382](https://github.com/boykopovar/AnyPS5/blob/a453108cf7768b71879b0e832d367a935c43440d/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp#L382). A planned table image is now one `info.images` entry that heap placement skips ([BindingAllocator.cpp:140](https://github.com/boykopovar/AnyPS5/blob/e34c479210c78d7b160d7054f3e72de422b23d7a/core/shader/recompiler/Optimization/src/BindingAllocator.cpp#L140)). Its records go to the image-table binding, whose size [`ImageTableCapacity`](https://github.com/boykopovar/AnyPS5/blob/e34c479210c78d7b160d7054f3e72de422b23d7a/core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp#L3963) caps by the device's descriptor limits, not to 16 heap slots per table. So the 69-slot count in the report above no longer applies if the four tables plan as columns ([`TryMakeTableColumn`](https://github.com/boykopovar/AnyPS5/blob/e34c479210c78d7b160d7054f3e72de422b23d7a/core/shader/recompiler/Optimization/src/ResourceTracker.cpp#L542)); only a run shows whether they do. `APS5_TRACE_BINDLESS` and `APS5_BINDLESS_MATERIAL_SCAN` are gone as well; the trace is now `APS5_TRACE_IMAGE_TABLE=1`. **Conflicts with `main` e34c47921** (`git merge-tree --write-tree` on today's heads, not built): | PR | head | conflicting files | |---|---|---| | #5620 | ee9506603 | 5: `ResourceTracker.cpp`, `ResourceMaterializer.cpp`, `ControlFlowInfo.hpp`, `ShaderDiskCache.cpp`, `tests/ShaderDiskCache.cpp` | | #5820 | 727387252 | the same 5 + `ShaderDiskCache.hpp` | | #4475 | e354f9a61 | 9 as a branch (still stacked on #758's earlier head a5c63d524); its own two commits replayed onto e34c47921: none | | #1184 (draft) | 5f3e66d0b | 18 | #5620 and #5820 change `IndirectImage` and `TryMakeTableImage`, which #757 deleted (in `ControlFlowInfo.hpp` the conflict is #5620's whole `IndirectImage` struct against nothing), so a rebase alone can't clear them. They need a port to `TryMakeTableColumn`, or nothing if the columns already plan these shaders. Two hints that they might, neither a title result: - [`verifyUniformTableImage`](https://github.com/boykopovar/AnyPS5/blob/e34c479210c78d7b160d7054f3e72de422b23d7a/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp#L1823) requires a 48-byte record with the T# at +16 to plan as one column with stride 48 (a synthetic test). - @EagleBearerYS's Village run with #757 on their stack ([comment](https://github.com/boykopovar/AnyPS5/pull/757#issuecomment-6164648878)) planned every table up to the title as one 32768-record column at stride 0x30, addend 0x10. **Run request.** @xXPBSXx (PRAGMATA PPSA02530) and @simonbronk (Onimusha PPSA27836), could you run `main` e34c47921 with only the start-up fixes you need (#5776 merges cleanly on it; for Onimusha the others in #5769), without #5620, #5820 or the local `MaxImages`/`SampledHeapCapacity` 128 change, and with `APS5_TRACE_IMAGE_TABLE=1`? The "before" is @xXPBSXx's two PRAGMATA runs on 84b01f9cd ([comment](https://github.com/boykopovar/AnyPS5/pull/5620#issuecomment-6172242757)) and @simonbronk's Onimusha first screens on the pre-#757 path ([comment](https://github.com/boykopovar/AnyPS5/discussions/5769#discussioncomment-18927702)). What would settle it: - whether the `GetImageResource dword 0` stop on the 48-byte records comes back - the `[image-table] shader 0x... table N` lines for the shaders that stopped before - any `image table:` fault line, and the first new stop Wolverine (@mrfelek's [count](https://github.com/boykopovar/AnyPS5/discussions/5516#discussioncomment-18923711)) and SAROS (@JJenkx's [run](https://github.com/boykopovar/AnyPS5/discussions/1504#discussioncomment-18918796)) also hit these removed messages, so a run on `main` would answer the same question there. @MichonGoddijn231849 @simonbronk: #1184 was parked because tables expanded statically into the sampled heap ([comment](https://github.com/boykopovar/AnyPS5/pull/1184#issuecomment-6077390489)). #757 replaced that expansion, so the runs above should show whether the redesign offered [here](https://github.com/boykopovar/AnyPS5/pull/1184#issuecomment-6167946072) is still needed. @Pipodi: both bases of #4475 are in `main` now, and its two commits apply onto e34c47921 without textual conflicts. cc @Celegans12 AI-assisted: written with Claude Code; I checked the live threads of #757, #758, #5620, #5820, #4475, #1184, #5769, #5516, #1504 and this issue, and the cited lines at a453108cf and e34c47921. I ran `git merge-tree` on the fetched heads against e34c47921 and `git grep` on a453108cf and e34c47921. No build and no title run.
simonbronk commented 2026-10-14 19:12:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by simonbronk on 2026-10-14T19:12:01Z.


@nikowolf123 an Onimusha (PPSA27836) run on current main, as you asked.

Setup: Windows 11 Pro 26200, RTX 5070, main ed835aa76 with the other PRs the title needs (#5769), but without #5620 or #5820, and with MaxImages unchanged.

Across six runs of 9 to 20 minutes (about 16,000 shaders compiled), there were no bindless-table, static bindless image capacity exceeded or material-key errors. Before #757/#758, the title stopped on those at its first presentation. So #757/#758 cover what #5620 and #5820 did for this title. I'm closing #5820 as superseded.

The title now stops in other places: a guest snapshot differs from registered memory race (#5484 handles it), and a black screen after that, which I'm following on #5769.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6176252146 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5720#issuecomment-6176252146). Originally posted by [simonbronk](https://github.com/simonbronk) on 2026-10-14T19:12:01Z. --- @nikowolf123 an Onimusha (PPSA27836) run on current `main`, as you asked. Setup: Windows 11 Pro 26200, RTX 5070, `main` ed835aa76 with the other PRs the title needs (#5769), but **without** #5620 or #5820, and with `MaxImages` unchanged. Across six runs of 9 to 20 minutes (about 16,000 shaders compiled), there were no bindless-table, `static bindless image capacity exceeded` or material-key errors. Before #757/#758, the title stopped on those at its first presentation. So #757/#758 cover what #5620 and #5820 did for this title. I'm closing #5820 as superseded. The title now stops in other places: a `guest snapshot differs from registered memory` race (#5484 handles it), and a black screen after that, which I'm following on #5769.
oneandonlydean commented 2026-10-14 21:39:02 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T21:39:02Z.


#757 and #758 are merged, so bindless tables are now indexed at their runtime offsets instead of counting against MaxImages. On Onimusha the same static bindless image capacity exceeded stop no longer comes up on main (see above). Closing; please reopen if PRAGMATA still stops on it on current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179075319 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/5720#issuecomment-6179075319). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T21:39:02Z. --- #757 and #758 are merged, so bindless tables are now indexed at their runtime offsets instead of counting against `MaxImages`. On Onimusha the same `static bindless image capacity exceeded` stop no longer comes up on main (see above). Closing; please reopen if PRAGMATA still stops on it on current main.
Sign in to join this conversation.
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#5720
No description provided.