-
Notifications
You must be signed in to change notification settings - Fork 921
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
Backport device limits fix to 0.17 #4964
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good after nit.
Please re-request my review after it's addressed!
@@ -50,8 +50,8 @@ path = "./wgpu-hal" | |||
version = "0.17" | |||
|
|||
[workspace.dependencies.naga] | |||
git = "https://github.com/gfx-rs/naga" | |||
rev = "bac2d82a430fbfcf100ee22b7c3bc12f3d593079" | |||
# git = "https://github.com/gfx-rs/naga" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got accidentally committed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was actually not an accident. Without removing this, there are naga version conflicts when building against other packages. Is there a reason this particular commit is targeted rather than the version on crates.io?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The commit here is just the commit for the release of 0.17 - the sources are the same. When locally patching, you should be able to patch both wgpu and naga to the same place and it work fine. Something like:
[patch.crates-io]
wgpu = { git = "https://github.com/gfx-rs/wgpu.git", rev = "7b7dfa6" }
wgpu-core = { git = "https://github.com/gfx-rs/wgpu.git", rev = "7b7dfa6" }
wgpu-hal = { git = "https://github.com/gfx-rs/wgpu.git", rev = "7b7dfa6" }
wgpu-types = { git = "https://github.com/gfx-rs/wgpu.git", rev = "7b7dfa6" }
naga = { git = "https://github.com/gfx-rs/naga.git", rev = "bac2d82a430fbfcf100ee22b7c3bc12f3d593079" }
@cshenton-work do you still need this or are you on a newer version by now? |
As this PR has gone stale, I'm going to close it - please refile it if you have hte need for this |
Description
This commit in 0.18 and later fixed an issue where limits passed to
request_device
would be dropped due to an upstream issue withwasm_bindgen
andweb_sys
.This PR backports that fix to 0.17 so that dependent packages can enjoy correct device initialisation behaviour on the web.
Testing
This has been tested alongside a modified copy of
bevy 0.12.0
(updated to depend onwgpu 0.17.2
), to confirm that the device limits are now respected. For example device request properly fails on too large amaxBufferSize
and no longer errors when buffers less than the requestedmaxBufferSize
, but greater than the default max size, are created.Checklist
cargo fmt
.cargo clippy
. If applicable, add:--target wasm32-unknown-unknown
noise
]--target wasm32-unknown-emscripten
cargo xtask test
to run tests.CHANGELOG.md
. See simple instructions inside file.