-
Notifications
You must be signed in to change notification settings - Fork 860
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
The maximum vertex buffer input bindings is set too low #558
Comments
Thank you for filing!
What use case do you have to need more than 4? :) You are right that we need to support at least 16, according to Vulkan capabilities and our code in gfx-rs for other backends. Although, it's a bit more tricky than it seems on Metal: the vertex bindings are shared between descriptor resources and vertex attributes. And it can have up to 31 vertex buffer in total... So there must be a balance between how many vertex buffers we allow coming for the attributes, versus ones coming in a bind group. And I'd much prefer to have the higher limit for the latter, since I don't find multiple vertex buffers particularly useful.
Yes, I think |
Loading glTF files using their buffers as-is without converting the vertex input. The attributes aren't necessarily interleaved and the offset into the view sometimes exceeds the stride. It makes it difficult or impossible to put the attributes on a single buffer binding and you either need to (1) create an input binding per attribute or (2) pre-process the input into a custom/known vertex format. I'm trying to solve for (1) because (2) prevents you from loading the data directly. Although most assets aren't going to have all of these attributes, once you run into models with animation, you can go past the limit of 8 pretty easily (which is what happened to me).
** I have a flag in the shader that disables morph targets 2 and 3 during compilation if only 16 input bindings are supported. This is why I opened gfx-rs/wgpu-rs#239. |
I want to say that glTF is just not doing its best here - KhronosGroup/glTF#21 |
Additionally, the input states are now stored in a `SmallVec` to enable higher limits. Fixes gfx-rs#558
Additionally, the input states are now stored in a `SmallVec` to enable higher limits. Fixes gfx-rs#558
Additionally, the input states are now stored in a `SmallVec` to enable higher limits. Fixes gfx-rs#558
wgpu/wgpu-core/src/device/mod.rs
Line 37 in 77d95f5
A super conservative value would be 16, but modern hardware supports 32 vertex input bindings.
https://vulkan.gpuinfo.org/displaydevicelimit.php?name=maxVertexInputBindings
The error I ran into manifested as a slice index out of bounds. I think this should really be a
SmallVec
or something similar that can handle more than the bare minimum.wgpu/wgpu-core/src/command/render.rs
Line 971 in 77d95f5
The text was updated successfully, but these errors were encountered: