Skip to content
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

Open
jimblandy opened this issue Nov 3, 2022 · 0 comments
Open

Support zero-length vertex/index buffers #3170

jimblandy opened this issue Nov 3, 2022 · 0 comments
Labels
area: api Issues related to API surface

Comments

@jimblandy
Copy link
Member

The WebGPU specification says that setVertexBuffer and setIndexBuffer may be passed a size of zero, but wgpu doesn't support this: the set_index_buffer and set_vertex_buffer methods take BufferSlice values, which are not allowed to be empty.

(Show-stopping, I know.)

@jimblandy jimblandy added the area: api Issues related to API surface label Nov 3, 2022
jimblandy added a commit to jimblandy/wgpu that referenced this issue Nov 3, 2022
`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.
jimblandy added a commit to jimblandy/wgpu that referenced this issue Nov 3, 2022
`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.
jimblandy added a commit that referenced this issue Nov 3, 2022
`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.
@teoxoy teoxoy added this to the WebGPU Specification V1 milestone Dec 5, 2022
@teoxoy teoxoy changed the title Deno bindings don't support zero-length vertex/index buffers Support zero-length vertex/index buffers Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api Issues related to API surface
Projects
None yet
Development

No branches or pull requests

2 participants