-
Notifications
You must be signed in to change notification settings - Fork 328
Remove the greater-or-equal constraint on maxBindingsPerBindGroup #4484
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Previews, as seen when this build job started (8c11d71): |
Changing this probably makes sense (we wrote it conservatively to start). That would require Firefox to choose if it wants to:
|
Sounds good to me. Should the new constraint be (for each |
Sorry for the slow reply, I had a hard time figuring out the answer. Editors (@jimblandy @toji) just discussed it in our meeting, and @jimblandy pointed out that if But I thought about this a bit more after the meeting, while writing this down. The original hope was that maxBindingsPerBindGroup would never restrict how much you can bind, only the maximum Practically speaking, right now it's totally impractical to use 1M bindings because we do not have binding arrays (#822), so perhaps we should hold onto this restriction at least until that issue is being resolved. It may not even really be relevant until bindless (#380) is being resolved? I have a vague recollection that super high limits in Vulkan are only really usable with bindless. But I know very little about how bindless works so I'm not sure. In the meantime, implementations would need to pick a balance of lowering the PerShaderStage limits and raising maxBindingsPerBindGroup. I believe it's also possible to raise maxBindingsPerBindGroup to infinity by repacking sparse bindings to be contiguous. |
Alright, I preferred your earlier suggestion but in the short term Firefox will restrict
Let's have this discussion again during or after the resolution of a bindless API, then.
There is a desire on the wgpu side to keep the vulkan backend simple since the binding model aligns well with WebGPU, instead of renaming the bindings which IIRC requires deferring the creation of shader modules to pipeline creation (granted we already do it on at least one other backend, I know that Dawn does it for all its backends). Just passing that one CTS test isn't motivation enough to change that and I don't think the spec should make renaming bindings mandatory without stronger motivating factors. |
This constraint is problematic for configurations where the theoretical maximum number of bindings is very large. For example on this linux desktop I get the following limits:
Which would mean
maxBindingsPerBindGroup
has to be very high.However, the intent behind
maxBindingsPerBindGroup
is to restrict the maximum binding index to "allows implementations to treat binding space as an array, within reasonable memory space, rather than a sparse map structure." Which is the case of the vulkan backend in Firefox.So high theoretical maximum binding limits should not force the maximum binding index to be raised to very large number and this formula in the spec should be removed.
There is also a CTS test
webgpu:api,validation,capability_checks,limits,maxBindingsPerBindGroup:validate:
that should be removed for the same reasons.