fix(shader): reserve heap space for sixteen sampler pairs #2141

Merged
authurtabo-byte merged 1 commit from upstream-pr/2141 into main 2026-10-10 06:13:09 +00:00
authurtabo-byte commented 2026-10-09 09:54:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by authurtabo-byte on 2026-10-09T09:54:51Z.


What

The sampler heap has 16 slots, but the allocator reserves both regular and comparison descriptors for each logical sampler. A shader using sixteen logical samplers therefore fails with shader sampler pairs exceed runtime heap capacity.

Reserve 32 slots so sixteen sampler pairs fit. Bump the runtime ABI version and update the shader-data layout assertions so cached artifacts with the previous layout cannot be reused. Existing Vulkan device-limit validation still applies.

Related #2282 changes storage-image heap capacity independently; this PR changes sampler-pair capacity and its ABI layout. Neither depends on the other; the shared header edits should be reconciled when merging.

Tested

Rebased onto main f8c2f072. Fresh independent Windows Release/NVIDIA build: device-profile, disk-cache, prepared-graphics and all five prepared-shader cases pass (8/8; 4.95 seconds). Conventions pass.

Windows 11, WinLibs GCC, Release, NVIDIA RTX 3050 Laptop GPU. Added a sixteen-sampler allocation regression to agc_shader_device_profile; it fails before this change and passes afterward. Shader device profile, disk-cache, prepared-graphics and five prepared-shader cases pass (8/8).

MiniGolf previously aborted after its Unity logo with the sampler-capacity error. In a build combining this change with its separate startup and rendering dependencies, it now renders the main menu and responds to course-selection input. Entering gameplay still encounters an independent multisampling limitation; this is not a claim of playable gameplay from this change alone.

Conventions and whitespace checks pass. Linux and other titles were not run.

Checklist

  • Based on current main; no other open PR implements the same fix
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation files or images added to the repository
  • No third-party code added
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4798853872 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2141). Originally posted by [authurtabo-byte](https://github.com/authurtabo-byte) on 2026-10-09T09:54:51Z. --- ### What The sampler heap has 16 slots, but the allocator reserves both regular and comparison descriptors for each logical sampler. A shader using sixteen logical samplers therefore fails with `shader sampler pairs exceed runtime heap capacity`. Reserve 32 slots so sixteen sampler pairs fit. Bump the runtime ABI version and update the shader-data layout assertions so cached artifacts with the previous layout cannot be reused. Existing Vulkan device-limit validation still applies. Related #2282 changes storage-image heap capacity independently; this PR changes sampler-pair capacity and its ABI layout. Neither depends on the other; the shared header edits should be reconciled when merging. ### Tested Rebased onto main `f8c2f072`. Fresh independent Windows Release/NVIDIA build: device-profile, disk-cache, prepared-graphics and all five prepared-shader cases pass (8/8; 4.95 seconds). Conventions pass. Windows 11, WinLibs GCC, Release, NVIDIA RTX 3050 Laptop GPU. Added a sixteen-sampler allocation regression to `agc_shader_device_profile`; it fails before this change and passes afterward. Shader device profile, disk-cache, prepared-graphics and five prepared-shader cases pass (8/8). MiniGolf previously aborted after its Unity logo with the sampler-capacity error. In a build combining this change with its separate startup and rendering dependencies, it now renders the main menu and responds to course-selection input. Entering gameplay still encounters an independent multisampling limitation; this is not a claim of playable gameplay from this change alone. Conventions and whitespace checks pass. Linux and other titles were not run. ### Checklist - [x] Based on current `main`; no other open PR implements the same fix - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation files or images added to the repository - [x] No third-party code added - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
adriadam10 commented 2026-10-10 06:13:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:13:06Z.


Checked on Linux: build + libSceAgc/libSceAgcDriver ctest (293/293) green; agc_shader_device_profile fails with the RuntimeAbi.hpp change reverted and passes with it. The layout asserts match (+16 × 48 B in ShaderData, ExportMappingsDword +192), and the per-stage sampler limit check in ShaderResources.cpp still applies. Merging.

Note for the next ones to land: #2282 and #2347 touch the same lines of RuntimeAbi.hpp (Version, size asserts); the second to merge needs to rebase and take the next ABI version (12).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094540179 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2141#issuecomment-6094540179). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T06:13:06Z. --- Checked on Linux: build + libSceAgc/libSceAgcDriver ctest (293/293) green; `agc_shader_device_profile` fails with the `RuntimeAbi.hpp` change reverted and passes with it. The layout asserts match (+16 × 48 B in `ShaderData`, `ExportMappingsDword` +192), and the per-stage sampler limit check in `ShaderResources.cpp` still applies. Merging. Note for the next ones to land: #2282 and #2347 touch the same lines of `RuntimeAbi.hpp` (`Version`, size asserts); the second to merge needs to rebase and take the next ABI version (12).
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!2141
No description provided.