-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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 webgpu backend to latest dawn #7977
Conversation
- Rename usage of `WGPUSType_ShaderModuleWGSLDescriptor` to `WGPUSType_ShaderSourceWGSL`
- Use `WGPUOptionalBool` for `WGPUDepthStencilState.depthWriteEnabled`
Err, then what do you suggest? Couldn't both be supported via some ifdef or version check? Also see #7969 |
at the moment, dawn users are getting the short end of the stick (it's always someone 😁). it may indeed be time to revisit the ifdef proposal in the issues mentioned above. taking a look. note that the current example is pretty heavily tied to dawn. #6188 appears to be an attempt to resolve this. |
Thank you for your help! |
it's definitely pretty wild west! truly, the crux of the issue is that everyone ships a slightly different version of the same interface ( I have confirmed that these changes break emscripten, which was passing before. |
OK. neither dawn nor wgpu expose anything -- official, that is -- that would allow us to key on the implementation. eventually this problem will go away. in the meantime, providing defines of the form note that we have two options in this case. we can provide a default, i.e. prefer one implementation over the other. it would make some sense to use dawn, given that the current example only supports dawn. alternatively, we can force the user to define one or the other. this is what I've added to the PR currently. |
This is a good idea, probably the best we can do the meanwhile. I would add some commentary in imgui_impl_wgpu.h to increase visibility. Thanks! |
ah, yes, I had meant to add a comment! thank you for the notes. everything look OK? changes are welcome.
I have tested this patch on the repo example with both dawn and emscripten. we have no path currently to test with wgpu, but I tested it locally. everything looks good to go there. |
thinking about the changelog -- a rename of this PR might be in order. |
Merged as 1ac162f, thank you! |
Someone mentioned not being able to build this, presumably because they use a slightly older version of DAWN. Do we have access to some compile-time version number that we can use to better support them? |
as far as I can tell (I peeked into this recently) google doesn't version dawn in any way, at least externally. or rather, they version by hash. it's a rolling release. so there's not really much to work off, there. wgpu is a little better, but things still feel fast and loose. I recommend only supporting latest, at least until the implementations become more stable. where would we draw the line? we probably shouldn't be beholden to every user's specific checkout. as far as your someone goes -- where are they getting their dawn? it seems unlikely that they are tied to any specific version as such, but perhaps they are dependent on a third party's release cycle (some homebrew projects package ad hoc binaries afaik, but aren't officially supported). the ShaderSource rename is about a month old, I think. a quick fix could be to try compiling with IMGUI_IMPL_WEBGPU_BACKEND_WGPU instead of _DAWN -- that might work here, until they upgrade. otherwise, if I was a user in this situation, I would maintain a fork / patch. |
these changes ensure compatibility between imgui's webgpu backend and the
webgpu.h
header provided by the dawn webgpu implementation.in addition, the dawn native example in
examples/example_glfw_wgpu
currently does not build; with this patch, the example builds and runs (although note that it uses a fair amount of deprecated API and is a ways off spec).unfortunately, this change will break compatibility between imgui's webgpu backend and wgpu-native, as far as I can tell. this will almost certainly impact downstream wgpu users. I have not checked emscripten.
see also:
#6602
#6188
#7523