Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Fix initializing buffer with unaligned data #900

Merged
merged 1 commit into from
May 7, 2021
Merged

Conversation

Uriopass
Copy link
Contributor

@Uriopass Uriopass commented May 7, 2021

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 (Yatekii/imgui-wgpu-rs#54) to wgpu 0.8 since they use U16 index buffers with odd lengths.

In wgpu 0.7, this was a valid operation, the zero padding was done by hand. 
However in gfx-rs#872 this was removed as an optimization since buffers are zero padded, however the slice end was taken from buffer.slice which has to be aligned when mapped.
Copy link
Collaborator

@grovesNL grovesNL left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thank you!
bors r+

@bors
Copy link
Contributor

bors bot commented May 7, 2021

@bors bors bot merged commit e1f5f9a into gfx-rs:master May 7, 2021
@kvark
Copy link
Member

kvark commented May 7, 2021

Do you need a patch for this?

@Uriopass
Copy link
Contributor Author

Uriopass commented May 7, 2021

That would be great!

@kvark
Copy link
Member

kvark commented May 7, 2021

It's on crates!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants