fix(recompiler): size a typed storage heap for several images, not one dynamic image #2282
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2282"
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 MathiasDevelopes on 2026-10-09T14:31:15Z.
What
A typed storage-image heap held
StorageHeapCapacity= 4 elements, and a dynamic-mip storage image reserves that many for its mip slots ([BindingAllocator::place](https://github.com/boykopovar/AnyPS5/blob/main/core/shader/recompiler/Optimization/src/BindingAllocator.cpp)). A shader with one dynamic-mip storage image and any other storage image of the same class therefore needed 5 elements and failed:Planet Coaster (PPSA01736) hits this with a mip-chain compute shader: the allocator reported group 30 needing 5 of 4 for 6 images (from a temporary diagnostic in the failure message). The title aborts there.
The constant is split in two:
StorageMipSlots= 4 stays the number of slots per dynamic-mip image, andStorageHeapCapacitybecomes 16, the elements one storage heap can hold. Heap arrays are declared with their compact length (binding.count), so every shader that fitted before gets the same layout and SPIR-V. The ABI structs andVersionare unchanged.Related open PRs: #757 and #758 also use
StorageHeapCapacityfor the dynamic mip count inResourceMaterializer.cpp; whichever lands second needs to pick up the rename toStorageMipSlotson that line. #2141 changes the sampler heap size only.Tested
Windows 11, MinGW-w64 15.2.0.
agc_shader_device_profile: a storage heap now holds two dynamic-mip images (8 elements), fills to exactlyStorageHeapCapacity, and still rejects one image more withheap capacity exceeded. The previous version of the test expected the second image to be rejected, so it fails with the old constant.tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository🤖 Generated with [Claude Code](https://claude.com/claude-code)
Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-10-09T14:31:21Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T14:44:03Z.
I reviewed the full diff against current
main; separating the per-image mip slot count from the aggregate storage-heap limit is internally consistent, and the PR’s Windows full-suite report plus all three relinker jobs are useful coverage. The upstream Build run skipped both full Linux and Windows jobs, though, and the contribution matrix asks for those jobs on the PR head. Could an authorized collaborator dispatch the full Build workflow before merge? I see #2141 changes the adjacent sampler-capacity/ABI version inRuntimeAbi.hpp; the changes are semantically separate, but the final merge order should preserve both updates and the sampler ABI version bump.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-09T17:09:03Z.
Follow-up to the overlap note: #2347 now also touches the adjacent
RuntimeAbi.hppcapacity lines. It raisesSampledHeapCapacity, while this PR raisesStorageHeapCapacityand splits outStorageMipSlots; these are separate capacities with no dependency, and both changes need to survive the merge.Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-09T22:05:07Z.
Additional Arch Linux validation of head
85268f86742cfe4ca270ec3431c036cc3e8aae02, cherry-picked alone onto main19a0daa7(local validation commitc6839278).Environment: Arch under WSL2, GCC 16.2.1, CMake 4.4.4, kernel 6.6.87.2-microsoft-standard-WSL2, Vulkan lavapipe/llvmpipe LLVM 23.1.1.
libsbuild completed.agc_driver_flat_store, also reproduced after rebuilding that target on unchanged mainda122c90; there are no additional failure names. Skips reflect the software device's capabilities and platform-specific tests.agc_shader_device_profilepasses in 0.01 s, including two dynamic-mip storage images sharing a heap, filling its capacity, and rejecting overflow. The per-image mip slot count remains four.This validation includes only this PR's changes on main, without the other adjacent heap-capacity PRs. Written with AI assistance.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:16:15Z.
Checked the diff, built and ran the libSceAgc/libSceAgcDriver ctest (all green,
agc_shader_device_profileincluded); without the change the new test doesn't build, and it covers two dynamic-mip images, a full heap and one image over. Heap arrays keep their compactbinding.count, so layouts of shaders that already fitted are unchanged and no ABI bump is needed.The PR conflicted with main in
ResourceMaterializer.cpp(adjacent lines); I rebased it onto current main, no logic change. Merging once CI is green.Thanks @MarcZX100 and @Mouhand-Kaddo for the extra runs.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:48:53Z.
Rebased onto current main again: the only conflict was in
RuntimeAbi.hppnext to the sampler heap change from #2141 (merged). KeptStorageMipSlots = 4,StorageHeapCapacity = 16and main'sSamplerHeapCapacity = 32; no logic change. libSceAgc/libSceAgcDriver ctest is green,agc_shader_device_profileincluded. Merging once CI is green.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T06:51:53Z.
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)core/shader/recompiler/RuntimeAbi.hppL37-38