You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using Dawn for WebGPU at head (as of writing, this commit) with GLFW (also at head) on macOS targeting macOS with CMake, the following build errors are triggered:
[build] /Users/nickchavez/src/wgpu_imgui_bug/external/imgui/backends/imgui_impl_wgpu.cpp:281:27: error: no viable overloaded '='
[build] stage_desc.entryPoint = "main";
[build] ~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~
[build] /Users/nickchavez/src/wgpu_imgui_bug/build/default/external/dawn/gen/include/dawn/webgpu.h:2384:16: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'const char[5]' to 'const WGPUStringView' for 1st argument
[build] typedef struct WGPUStringView {
[build] ^
[build] /Users/nickchavez/src/wgpu_imgui_bug/build/default/external/dawn/gen/include/dawn/webgpu.h:2384:16: note: candidate function (the implicit move assignment operator) not viable: no known conversion from 'const char[5]' to 'WGPUStringView' for 1st argument
[build] 1 error generated.
and the similar:
[build] /Users/nickchavez/src/wgpu_imgui_bug/external/imgui/backends/imgui_impl_wgpu.cpp:532:24: error: no viable overloaded '='
[build] tex_desc.label = "Dear ImGui Font Texture";
[build] ~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
[build] /Users/nickchavez/src/wgpu_imgui_bug/build/default/external/dawn/gen/include/dawn/webgpu.h:2384:16: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'const char[24]' to 'const WGPUStringView' for 1st argument
[build] typedef struct WGPUStringView {
[build] ^
[build] /Users/nickchavez/src/wgpu_imgui_bug/build/default/external/dawn/gen/include/dawn/webgpu.h:2384:16: note: candidate function (the implicit move assignment operator) not viable: no known conversion from 'const char[24]' to 'WGPUStringView' for 1st argument
[build] 1 error generated.
It seems that for the Dawn backend, these lines need to be rewritten as such:
#ifdef IMGUI_IMPL_WEBGPU_BACKEND_DAWN
tex_desc.label = { "Dear ImGui Font Texture", WGPU_STRLEN };
#else
tex_desc.label = "Dear ImGui Font Texture";
#endif
Even when these are fixed however, the following runtime WGPU errors are produced:
Binding size (80) is larger than the size (0) of [Buffer "Dear ImGui Uniform buffer
Value 115200 is invalid for WGPUBufferUsage.
- While calling [Device].CreateBuffer([BufferDescriptor ""Dear ImGui Vertex buffer
Value 22544 is invalid for WGPUBufferUsage.
- While calling [Device].CreateBuffer([BufferDescriptor ""Dear ImGui Index buffer
[Invalid Buffer "Dear ImGui Vertex buffer
[Invalid Buffer "Dear ImGui Index buffer
Write range (bufferOffset: 0, size: 64) does not fit in [Buffer "Dear ImGui Uniform buffer
Write range (bufferOffset: 64, size: 4) does not fit in [Buffer "Dear ImGui Uniform buffer
[Invalid Buffer "Dear ImGui Vertex buffer
[Invalid CommandBuffer] is invalid.
- While calling [Queue].Submit([[Invalid CommandBuffer]])
which point to the following lines, which likely should be corrected as:
Since WGPUBufferDescriptor's WGPU_BUFFER_DESCRIPTOR_INIT convenience initializer has a field label which has its own WGPU_STRING_VIEW_INIT convenience initializer which now takes 2 arguments, the label's value and its length.
Version/Branch of Dear ImGui:
Version 1.91.4, Branch: master
Back-ends:
imgui_impl_wgpu.cpp + imgui_impl_glfw.cpp
Compiler, OS:
macOS 14.7 + Clang 15
Full config/build information:
No response
Details:
My Issue/Question:
When using Dawn for WebGPU at head (as of writing, this commit) with GLFW (also at head) on macOS targeting macOS with CMake, the following build errors are triggered:
and the similar:
It seems that for the Dawn backend, these lines need to be rewritten as such:
Even when these are fixed however, the following runtime WGPU errors are produced:
which point to the following lines, which likely should be corrected as:
Since
WGPUBufferDescriptor
'sWGPU_BUFFER_DESCRIPTOR_INIT
convenience initializer has a fieldlabel
which has its ownWGPU_STRING_VIEW_INIT
convenience initializer which now takes 2 arguments, the label's value and its length.Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
Minimal code example: https://github.com/nchavez324/wgpu_imgui_bug/blob/main/main.cc
The text was updated successfully, but these errors were encountered: