Repository navigation
feat(shader): accept more than 32 buffers per shader up to the device limit - #1066
Merged
Merged
Conversation
… limit The resource tracker refused a program's 33rd distinct V# with "buffer resource limit exceeded". The 32 was a recompiler constant, not a Vulkan limit: every buffer is one constant-indexed element of the guest buffers binding, which ShaderResources checks against the device's storage-buffer limits. Drop ShaderInfo::MaxBuffers and the tracker's refusal, and size the SPIR-V emitter's per-buffer offset list from the binding layout. When the user data and offsets do not fit in the push constants, they all go to the shader data buffer as before. ShaderResources counted only storage buffers against maxPerStageResources (200 on Intel UHD) and now adds the stage's sampled and storage images. agc_driver_many_buffers reads and writes 52 and 124 buffers, and agc_driver_graphics rejects buffers plus an image above the limit.
9 tasks done
Collaborator
|
Checked on RADV (merged onto current |
11 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. feat(libSceAgcDriver): back the global data share with driver-owned guest memory #285, feat(agc): single-sample sample masks as a per-quad-pixel discard #448, feat(agc): implement image and sampler tables indexed at runtime offsets #757-feat(agc): implement deferred faults for reads through null SRT pointers #759, feat(agc): implement min and max sampler reduction modes #815, refactor(recompiler): share the SPIR-V emission failure helper #832, feat(agc): implement 8 and 8_8 srgb image loads through unorm views #866, feat(recompiler): implement 64-bit image atomics #896, feat(agc): implement image_load through image tables #920, feat(agc): implement sint storage images through uint views #944, fix(shader): throw for constant lane reads outside the host subgroup #997, perf(shader): share the BDA byte read fallback between read sites #1043 and perf(agc): size the storage and sampled texture caches to the device #1059 edit other lines of these files and merge cleanly.Tested
maindb3e659: 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)