-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Fix for compile errors with wgpu backend on OSX/dawn #8898
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
Conversation
|
Have you tried with Emscripten and other backends? |
|
I haven't— is there a test I can run? |
There are examples apps running on Emscripten and supposedly Dawn, although the general status of it is a mess partly because there are PR coming from every direction, mostly #8381, but I myself don't have easy TL;DR; steps and compatibility tables to understand what's going on with those evolving API. |
|
The CI test for Emscripten fails on this with latest Emscripten: |
|
I understood that the issue with Dawn did not manifest in #8381 because it requires |
The previous code still referred to old Now it's already correct/changed: imgui/backends/imgui_impl_wgpu.cpp Lines 403 to 413 in 4deba36
where imgui/backends/imgui_impl_wgpu.cpp Lines 57 to 61 in 4deba36
@ocornut There are 9 occurrences in WGPU-Native, Dawn and "new" EMS library use all the updated structures (for several structures) @trbabb |
It's not. This PR is adding an extra level of braces that master and your current PR don't have.
I answered in #8381 (comment) that if I compile your branch with |
You're right, my bad, it's changed again. I was asking to @trbabb for the compiler version because:
Anyway, for reasons like this, I would prefer to change the implicit initialization of this (and some/few other) structure(s) in WGPUBufferDescriptor ub_desc;
ub_desc.nextInChain = nullptr;
ub_desc.label = { "Dear ImGui Uniform buffer", WGPU_STRLEN };
ub_desc.usage = WGPUBufferUsage_CopyDst | WGPUBufferUsage_Uniform;
ub_desc.size = MEMALIGN(sizeof(Uniforms), 16);
ub_desc.mappedAtCreation = false;
bd->renderResources.Uniforms = wgpuDeviceCreateBuffer(bd->wgpuDevice, &ub_desc);The implicit initializations are part of the old code, whose structure I have always tried to maintain (in |
|
Thanks for confirming. Happy to use either way (braces or explicit assignment). I'm just looking for a PR that I can merge, and this one breaks older Emscripten version. |
|
I have now pushed 3dc511c which solves this. |
On OSX clang when building for wgpu with
-DIMGUI_IMPL_WEBGPU_BACKEND_DAWN=1, the following errors occur:The definition for a wgpu BufferDescriptor is:
and for
WGPUStringView:In order for the
lengthparameter to be included in the string view, braces are needed around that parameter.