-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Support zero-length vertex/index buffers #3170
Comments
`RenderBundleEncoder::set_index_buffer` and `set_vertex_buffer` interpret a `size` of `None` to mean "from the given offset to the end of the buffer", but `std::num::NonZeroU64::new` produces `None` when its argument is zero, which is quite different. Fix this similarly to the way it's handled in `op_webgpu_render_pass_set_index_buffer`. The WebGPU spec says this should work; filed as gfx-rs#3170.
`RenderBundleEncoder::set_index_buffer` and `set_vertex_buffer` interpret a `size` of `None` to mean "from the given offset to the end of the buffer", but `std::num::NonZeroU64::new` produces `None` when its argument is zero, which is quite different. Fix this similarly to the way it's handled in `op_webgpu_render_pass_set_index_buffer`. The WebGPU spec says this should work; filed as gfx-rs#3170.
`RenderBundleEncoder::set_index_buffer` and `set_vertex_buffer` interpret a `size` of `None` to mean "from the given offset to the end of the buffer", but `std::num::NonZeroU64::new` produces `None` when its argument is zero, which is quite different. Fix this similarly to the way it's handled in `op_webgpu_render_pass_set_index_buffer`. The WebGPU spec says this should work; filed as #3170.
After upgrading from v0.20 to v22.0 I'm running into a new bug around this. Where previously I had slices being passed into I'm not even sure why the buffers are empty, perhaps an edge condition on startup, but I know it was working before so either something changed to cause the buffers to be empty or something changed to make empty slices fail. |
The WebGPU specification says that
setVertexBuffer
andsetIndexBuffer
may be passed a size of zero, but wgpu doesn't support this: theset_index_buffer
andset_vertex_buffer
methods takeBufferSlice
values, which are not allowed to be empty.(Show-stopping, I know.)
The text was updated successfully, but these errors were encountered: