fix(shader): support 32 logical samplers in runtime heap #6699

Merged
MarcZX10 merged 1 commit from upstream-pr/6699 into main 2026-10-17 05:45:03 +00:00
MarcZX10 commented 2026-10-16 05:11:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T05:11:25Z.


What

Closes #6692. Carries Tamalero's existing commit unchanged, preserving the original commit author and co-author metadata. The runtime sampler heap can currently hold 16 logical samplers because each uses two descriptor entries. This change raises it to 32, updates the runtime ABI version so old cached shaders are rebuilt, and reports the sampler count when allocation exceeds capacity.

The change adds profile coverage for 20 and 32 logical samplers. The issue reports that the new game reaches gameplay with this capacity change; I did not run the title locally.

Tested

  • python3 tools/check_conventions.py --base upstream/main passed.
  • Local Linux build of agc_shader_device_profile_tests did not complete with GCC 12: compilation stopped in unchanged SrtDescriptorEvaluation.cpp at Flags<MemoryFlags>() parsing. The changed BindingAllocator.cpp compiled before that failure, but I could not execute the focused CTest here.
  • The issue author reports the focused profile test passing with GCC 16.2.1. The LEGO Batman gameplay run used a local build with the same capacity/layout change but without this PR's ABI version bump and regression test; those runs are the author's, not mine.

Checklist

  • Based on current main; no open PR implements this capacity change
  • One topic per PR
  • No code comments added
  • Generic runtime behavior
  • No investigation files added to the repository
  • Depends on: none
  • Unblocks: PPSA16833, #6692
  • GPUs tested: n/a for my local build; the author's RTX 4090 title run is reported in #6692
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4883806794 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6699). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T05:11:25Z. --- ### What Closes #6692. Carries Tamalero's existing commit unchanged, preserving the original commit author and co-author metadata. The runtime sampler heap can currently hold 16 logical samplers because each uses two descriptor entries. This change raises it to 32, updates the runtime ABI version so old cached shaders are rebuilt, and reports the sampler count when allocation exceeds capacity. The change adds profile coverage for 20 and 32 logical samplers. The issue reports that the new game reaches gameplay with this capacity change; I did not run the title locally. ### Tested - `python3 tools/check_conventions.py --base upstream/main` passed. - Local Linux build of `agc_shader_device_profile_tests` did not complete with GCC 12: compilation stopped in unchanged `SrtDescriptorEvaluation.cpp` at `Flags<MemoryFlags>()` parsing. The changed `BindingAllocator.cpp` compiled before that failure, but I could not execute the focused CTest here. - The issue author reports the focused profile test passing with GCC 16.2.1. The LEGO Batman gameplay run used a local build with the same capacity/layout change but without this PR's ABI version bump and regression test; those runs are the author's, not mine. ### Checklist - [x] Based on current `main`; no open PR implements this capacity change - [x] One topic per PR - [x] No code comments added - [x] Generic runtime behavior - [x] No investigation files added to the repository - [x] Depends on: none - [x] Unblocks: PPSA16833, #6692 - [x] GPUs tested: n/a for my local build; the author's RTX 4090 title run is reported in #6692 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-16 05:32:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-16T05:32:31Z.


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 6177 core/libs/prx/libSceAgcDriver/tests/ShaderDeviceProfile.cpp
PR 6947 core/shader/recompiler/Optimization/src/BindingAllocator.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208827680 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6699#issuecomment-6208827680). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-16T05:32:31Z. --- <!-- pr-overlap --> 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 6177](https://www.github.com/boykopovar/AnyPS5/pull/6177) | `core/libs/prx/libSceAgcDriver/tests/ShaderDeviceProfile.cpp` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/shader/recompiler/Optimization/src/BindingAllocator.cpp` |
Tamalero commented 2026-10-16 05:45:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-16T05:45:18Z.


A correction to the testing notes: the focused profile test and the LEGO Batman run were built with GCC 16.2.1 (20260810), not GCC 15. It was a Linux Release build with BUILD_TESTING=ON. I haven't tried GCC 12, so I can't say anything about the SrtDescriptorEvaluation.cpp stop.

One more detail, already in #6692: the gameplay run used a local build with the same capacity and layout change, but without the version bump and the new test. The suite results are from commit 4a53994d6 itself.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6208979504 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6699#issuecomment-6208979504). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-16T05:45:18Z. --- A correction to the testing notes: the focused profile test and the LEGO Batman run were built with **GCC 16.2.1** (20260810), not GCC 15. It was a Linux Release build with `BUILD_TESTING=ON`. I haven't tried GCC 12, so I can't say anything about the `SrtDescriptorEvaluation.cpp` stop. One more detail, already in #6692: the gameplay run used a local build with the same capacity and layout change, but without the version bump and the new test. The suite results are from commit `4a53994d6` itself. *Tested and written by Claude (AI assistant) on a contributor's machine.*
MarcZX10 commented 2026-10-16 15:34:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T15:34:52Z.


Thanks for correcting the GCC version and clarifying the gameplay build composition. I updated the PR description to report GCC 16.2.1 and to distinguish the reported gameplay run from validation of this PR’s ABI-version bump and regression test.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6218957495 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6699#issuecomment-6218957495). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T15:34:52Z. --- Thanks for correcting the GCC version and clarifying the gameplay build composition. I updated the PR description to report GCC 16.2.1 and to distinguish the reported gameplay run from validation of this PR’s ABI-version bump and regression test.
fma-rc commented 2026-10-16 18:14:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-16T18:14:57Z.


I built and ran it here (Linux, GCC 16.2.1, PR merged onto main d9b696ddb). agc_shader_device_profile_tests passes with the PR and fails with main's BindingAllocator.cpp and RuntimeAbi.hpp (shader sampler pairs exceed runtime heap capacity), so the new 20 and 32 sampler cases are red without the change.

ShaderData grows from 14,528 to 16,064 bytes, so I checked the draw path on Astro's Playroom (PPSA01325, RTX 5080, NVIDIA 615.78.08), same scene, upstream trace, one run each:

main 93e54cedd this PR
frame_ms p50 / p99 122.6 / 134.0 122.7 / 136.5
draws per frame 1,357 1,367
CPU per draw 62.9 us 63.0 us

The pictures match and no new errors appeared. I don't have LEGO Batman, so the gameplay claim is untested here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6221872702 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6699#issuecomment-6221872702). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-16T18:14:57Z. --- I built and ran it here (Linux, GCC 16.2.1, PR merged onto `main` d9b696ddb). `agc_shader_device_profile_tests` passes with the PR and fails with `main`'s `BindingAllocator.cpp` and `RuntimeAbi.hpp` (`shader sampler pairs exceed runtime heap capacity`), so the new 20 and 32 sampler cases are red without the change. `ShaderData` grows from 14,528 to 16,064 bytes, so I checked the draw path on Astro's Playroom (PPSA01325, RTX 5080, NVIDIA 615.78.08), same scene, upstream trace, one run each: | | `main` 93e54cedd | this PR | |---|---|---| | frame_ms p50 / p99 | 122.6 / 134.0 | 122.7 / 136.5 | | draws per frame | 1,357 | 1,367 | | CPU per draw | 62.9 us | 63.0 us | The pictures match and no new errors appeared. I don't have LEGO Batman, so the gameplay claim is untested here.
MarcZX10 commented 2026-10-16 18:43:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T18:43:33Z.


Thanks for the independent Linux validation and the Astro’s Playroom comparison. The regression test’s red/green control confirms the 20- and 32-sampler cases exercise the capacity fix, and the title run adds useful evidence that the larger ShaderData layout did not change the observed rendering or materially affect this trace. I’ll keep the LEGO Batman result attributed to the earlier GCC 16.2.1 build and note that this run did not cover that title.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6222363070 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6699#issuecomment-6222363070). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T18:43:33Z. --- Thanks for the independent Linux validation and the Astro’s Playroom comparison. The regression test’s red/green control confirms the 20- and 32-sampler cases exercise the capacity fix, and the title run adds useful evidence that the larger `ShaderData` layout did not change the observed rendering or materially affect this trace. I’ll keep the LEGO Batman result attributed to the earlier GCC 16.2.1 build and note that this run did not cover that title.
Tamalero commented 2026-10-16 23:04:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Tamalero on 2026-10-16T23:04:25Z.


Title run on this PR's exact change, as asked above: with 4a53994d6 (ABI version 13 and the test included), LEGO Batman: Legacy of the Dark Knight (PPSA16833 v01.010.000) gets past the New Game stop from #6692.

Tree: main 5d9dcc42d + this commit (cherry-picked, patch-identical) + #6694's commit (also patch-identical) + the sceWebBrowserDialogOpenForPredeterminedContent hunk from #6447 for the Terms of Service screen, plus two input-only changes (#6569 and the MouseInput.cpp change of #6153). Fresh, empty shader cache, since the version bump changes the cache keys.

  • The opening cutscene after New Game loads in both runs that got past start-up, and one goes on into gameplay in the first area. No shader sampler pairs exceed runtime heap capacity in any of today's 3 logs.
  • The earlier gameplay run in #6692 was the same capacity change without the version bump and the test; this run closes that gap.
Details

Linux (CachyOS), RTX 4090, i9-14900K, GCC 16.2.1, Release. Relinked with --to-intel by the relinker at 5d9dcc42d. Two of the three runs stopped later for reasons outside this PR: one at "guest allocation … is still pinned by GPU work or an import" in the opening cutscene while the cold cache was compiling (about 25 s per frame), one at start-up on the storage-image write-back throw (the #6301 message), which didn't repeat. The run that reached gameplay used APS5_PIN_WAIT_MS=180000; I can't tell whether that or the warmer cache got it past the cutscene.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6226328339 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6699#issuecomment-6226328339). Originally posted by [Tamalero](https://github.com/Tamalero) on 2026-10-16T23:04:25Z. --- Title run on this PR's exact change, as asked above: with `4a53994d6` (ABI version 13 and the test included), LEGO Batman: Legacy of the Dark Knight (PPSA16833 v01.010.000) gets past the New Game stop from #6692. Tree: `main` `5d9dcc42d` + this commit (cherry-picked, patch-identical) + #6694's commit (also patch-identical) + the `sceWebBrowserDialogOpenForPredeterminedContent` hunk from #6447 for the Terms of Service screen, plus two input-only changes (#6569 and the `MouseInput.cpp` change of #6153). Fresh, empty shader cache, since the version bump changes the cache keys. - The opening cutscene after New Game loads in both runs that got past start-up, and one goes on into gameplay in the first area. No `shader sampler pairs exceed runtime heap capacity` in any of today's 3 logs. - The earlier gameplay run in #6692 was the same capacity change without the version bump and the test; this run closes that gap. <details><summary>Details</summary> Linux (CachyOS), RTX 4090, i9-14900K, GCC 16.2.1, Release. Relinked with `--to-intel` by the relinker at `5d9dcc42d`. Two of the three runs stopped later for reasons outside this PR: one at "guest allocation … is still pinned by GPU work or an import" in the opening cutscene while the cold cache was compiling (about 25 s per frame), one at start-up on the storage-image write-back throw (the #6301 message), which didn't repeat. The run that reached gameplay used `APS5_PIN_WAIT_MS=180000`; I can't tell whether that or the warmer cache got it past the cutscene. </details> *Tested and written by Claude (AI assistant) on a contributor's machine.*
MarcZX10 commented 2026-10-16 23:16:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T23:16:38Z.


Thanks for running the title on the exact published change, including ABI version 13 and the regression test. This closes the gap between the earlier capacity-only gameplay run and the current PR head: the title gets through New Game and into the opening area in the reported runs, with no sampler-capacity error. I have updated the PR description to distinguish this current-head result from the earlier run and to keep the later unrelated stops scoped to the supplied logs.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6226473455 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6699#issuecomment-6226473455). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-16T23:16:38Z. --- Thanks for running the title on the exact published change, including ABI version 13 and the regression test. This closes the gap between the earlier capacity-only gameplay run and the current PR head: the title gets through New Game and into the opening area in the reported runs, with no sampler-capacity error. I have updated the PR description to distinguish this current-head result from the earlier run and to keep the later unrelated stops scoped to the supplied logs.
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!6699
No description provided.