-
Notifications
You must be signed in to change notification settings - Fork 90
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
Update to wgpu-rs 0.8 #54
Comments
update: I spoke too soon. There's a runtime crash with error message that index buffers must be multiple of 4, which seems a bit weird... Crash occurs when uploading index buffers:
starting at line 498 in lib.rs |
- Also update other dependencies - TODO: imgui-wgpu is blocking this. See: Yatekii/imgui-wgpu-rs#54
Any update? Did you manage to get it working? I might take a look if you didn't :-) |
@Uriopass maybe you can look at #52 (comment) which still at least has the 4 byte issue |
Hi @Uriopass ! I did get it working, however the fix is certainly not the most effective one, but works fine for my cases atm. Upon index upload I just convert the indices to u32's instead of u16's. Have a look at https://github.com/klashenriksson/imgui-wgpu-rs/commits/wgpu-v0.8 (and klashenriksson@3c01713 for the alignment fix). I dont really have the bandwidth to do a proper fix for this atm but maybe my code can help get you started :) |
Found the issue upstream, buffer initialization was not done properly when providing unaligned data :-) |
900: Fix initializing buffer with unaligned data r=grovesNL a=Uriopass 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. Co-authored-by: Pâris DOUADY <[email protected]>
Nice! Good find :) |
@Uriopass nice, it still seems to be an issue that TriangleList can not be used with u16 indices though? I get |
I'm pretty sure imgui uses a TriangleList topology :) you should keep the I do get the error "0.094421 ERROR(no module): Unexpected varying type: Array { base: [1], size: Constant([5]), stride: 4 }" however I think that might just be a naga problem and it works for me it's not critical. |
yes thats what I figured as well but when you look at
this makes the indices be u32 |
No it doesn't, the indices format is determined at the set_index_buffer time in the renderpass. the strip_index_format should only be specified when in TriangleStrip mode, thus why you get the error. |
ah right somehow mixed None and Default in my mind and did not know enough about the API, thanks for the explanation 👍 |
900: Fix initializing buffer with unaligned data r=grovesNL a=Uriopass In wgpu 0.7, this was a valid operation, the zero padding was done by hand. In gfx-rs#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. Co-authored-by: Pâris DOUADY <[email protected]>
Hello!
wgpu-rs 0.8 was just released and had some minor changes to structure names and parameters. I have a fork ready which is updated to use wgpu 0.8, should I do a PR of that to bring this up to 0.8? :)
The text was updated successfully, but these errors were encountered: