Skip to content
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

Backends: WebGPU: include imgui.h before backend check #8437

Merged
merged 1 commit into from
Feb 26, 2025

Conversation

alan-j-hu
Copy link
Contributor

The backend check would always fail in non-Emscripten settings because imgui, and transitively imconfig.h, would not be included at this point in the code. The result is the following compile error, which modifying imconfig.h would not solve. (This issue can be worked around by supplying the definition via the build system.)

imgui/backends/imgui_impl_wgpu.cpp:48:6: error: #error exactly one of IMGUI_IMPL_WEBGPU_BACKEND_DAWN or IMGUI_IMPL_WEBGPU_BACKEND_WGPU must be defined!
   48 |     #error exactly one of IMGUI_IMPL_WEBGPU_BACKEND_DAWN or IMGUI_IMPL_WEBGPU_BACKEND_WGPU must be defined!
      |      ^~~~~

I'm trying to get IMGUI working with WebGPU under Dawn. I encountered this issue; afterwards there are some other compile issues that I need to solve.

The backend check would always fail in non-Emscripten settings because
imgui.h, and transitively imconfig.h, would not yet be included at
this point in the code.
@ocornut ocornut merged commit 8bd3e20 into ocornut:master Feb 26, 2025
@ocornut
Copy link
Owner

ocornut commented Feb 26, 2025

Merged, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants