gfx-rs / wgpu-rs

Rust bindings to wgpu native library
https://wgpu.rs
Mozilla Public License 2.0
1.69k stars 186 forks source link

Fix initializing buffer with unaligned data #900

Closed Uriopass closed 3 years ago

Uriopass commented 3 years ago

In wgpu 0.7, this was a valid operation, the zero padding was done by hand. In #872 this logic was removed as an optimization since buffers are already zero initialized, however the slice end was taken from buffer.slice which has to be aligned when mapped.

This is causing issues when trying to update imgui-wgpu-rs (https://github.com/Yatekii/imgui-wgpu-rs/issues/54) to wgpu 0.8 since they use U16 index buffers with odd lengths.

bors[bot] commented 3 years ago

Build succeeded:

kvark commented 3 years ago

Do you need a patch for this?

Uriopass commented 3 years ago

That would be great!

kvark commented 3 years ago

It's on crates!