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

deno_webgpu: Don't confuse zero with "to the end of the buffer". #3171

Merged
merged 1 commit into from Nov 3, 2022

Conversation

jimblandy
Copy link
Member

@jimblandy jimblandy commented 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.

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

`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 jimblandy force-pushed the deno-index-vertex-zero-length branch from 3a4b985 to 47adbe6 Compare November 3, 2022 07:24
@jimblandy jimblandy merged commit 9fb9dbf into gfx-rs:master Nov 3, 2022
@jimblandy jimblandy deleted the deno-index-vertex-zero-length branch November 23, 2022 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants