feat(agc): bind storage buffers update-after-bind above the per-stage limit #1580
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1580"
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 Zheorgyan on 2026-10-08T13:26:35Z.
What
agc_driver_many_buffersfails on Apple GPUs with "shader descriptors exceed per-stage limits". MoltenVK reportsmaxPerStageDescriptorStorageBuffers31 andmaxDescriptorSetStorageBuffers155 on every Apple GPU, while the test binds 124 buffers in one stage. its update-after-bind limits are 1000000, and the guest buffers are one constant-indexed array binding, so the shaders don't need to changewhen a stage's storage buffers or resources go above the regular per-stage limit, or the set's storage buffers above the per-set limit, and the device has
descriptorBindingStorageBufferUpdateAfterBind, the set now uses the update-after-bind limits instead of throwingVulkanDeviceenablesdescriptorBindingStorageBufferUpdateAfterBindwhen available and passesVkPhysicalDeviceDescriptorIndexingPropertiesthrough the context. without the feature those limits stay 0 and the old error is thrownUPDATE_AFTER_BIND_POOLwithUPDATE_AFTER_BINDon its storage-buffer bindings, and is allocated from a separate chain of pools created withUPDATE_AFTER_BIND. the layout key carries the flag. the two places that created layouts shareCreateSetLayoutnow, and the two that created single-set pools shareCreateSetPoolValidateDescriptorLayout, added on main since this PR was opened, takes the same flag and checks such a set againstmaxPerStageUpdateAfterBindResourcesinstead ofmaxPerStageResourcesTested
macos-portbranch, before the rebase.agc_driver_many_buffersfails before and passes after. the rest of the suite ran with-j1 --timeout 30without the flip and display tests andagc_driver_lds_atomics64. 427 tests, and the 2 that fail,agc_driver_pixel_interlockandagc_driver_sdwa_float_selectors, fail the same way without this changeagc_driver_graphicshas a new case on the mock device. 17 buffers over a per-stage limit of 16 get the update-after-bind layout, binding flag and pool, an update-after-bind limit of 16 still throws, and one buffer keeps the regular layout. with the switch to update-after-bind removed, the new case failsa8b032b2. builds,agc_driver_graphics,agc_driver_many_buffers,agc_driver_typed_heaps,agc_driver_oversized_descriptor_setsandagc_driver_prepared_graphicspass. 26 of the 207agc_drivertests fail, with illegal instruction and segfault crashes of this x86-64 emulated container and wrong values inimage_sint8andshader_clock, none of them in descriptor code910a777fand passed on linux and windows: https://github.com/Zheorgyan/AnyPS5/actions/runs/37902941264tools/check_conventions.pypassesChecklist
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 (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by yahya308 on 2026-10-08T15:28:59Z.
Tested on top of main
9e2ffe0d, Windows 11, MinGW-w64 GCC 16.2.0, full ctest withANYPS5_REQUIRE_VULKAN=1 --repeat until-fail:3, NVIDIA RTX 4070 Laptop (32.0.16.1074) and AMD Radeon 780M (32.0.31041.1004).vopc_compare_tablefails on the 780M on main too (#825, #1473).Head
cb7bb927: no change from main on either GPU.many_bufferspasses on both.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T00:18:55Z.
Checked the limit logic (per-stage, per-set,
ValidateDescriptorLayout), the layout key, the separate update-after-bind pool chain and cleanup;agc_driver_graphicsandagc_driver_prepared_graphicspass on the PR merged onto main, and the new case doesn't build without the change. The redlinux/windowsjobs wereagc_shader_fusion_testsmissingspirv/unified1/spirv.hpp, a main breakage fixed in37bc6f2e7, not this PR.Rebased onto current main (no code changes) to get a clean CI run; merging once it's green. Not verified here: MoltenVK/Apple at runtime.