feat(shader): accept more than 32 buffers per shader up to the device limit #1066
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1066"
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 Celegans12 on 2026-10-07T07:22:26Z.
What
A program with more than 32 distinct buffer descriptors (V#s) throws
buffer resource limit exceeded. The 32 is a recompiler constant,ShaderInfo::MaxBuffers, not a Vulkan limit, so this PR drops it.ShaderResourcesalready throws above the storage-buffer limits: 1,048,576 per stage on an RTX 3080 Laptop, 1,015,808 on lavapipe, 200 on Intel UHD.buildPreparecounted only storage buffers againstmaxPerStageResources(also 200 on Intel UHD) and now adds the stage's sampled and storage images, not samplers. A pixel shader's colour attachments still aren't counted (TechnicalDebt).memoryByteOffsetsis sized from the binding layout, not 32 entries. When the user data and offsets no longer fit in the push constants, the whole block moves to the shader data buffer, as before.main.AddBufferlimit and per-stage count; whichever lands second drops the duplicate. #285, #448, #757-#759, #815, #832, #866, #896, #920, #944, #997, #1043 and #1059 edit other lines of these files and merge cleanly.Tested
maindb3e6598: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)VK_DRIVER_FILES): 382/382 pass;agc_driver_flat_storeis left out there because it takes several minutes on Windows llvmpipeagc_driver_many_buffersreads and writes 52 buffers (push constants) and 124 (shader data), three in four not 16-byte aligned.agc_driver_graphics: two buffers and a sampled or storage image throw atmaxPerStageResources2, not 3; samplers don't count. Both fail onmain.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 (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T12:20:31Z.
Checked on RADV (merged onto current
main, 395/395): no other per-buffer 32-entry table or mask is left, both new tests fail without the change, andagc_driver_many_buffersruns in 1.4 s cold on CI's lavapipe. Merging.