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
Copy file name to clipboardExpand all lines: backends/imgui_impl_wgpu.cpp
+41-31Lines changed: 41 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -1,13 +1,15 @@
1
1
// dear imgui: Renderer for WebGPU
2
-
// This needs to be used along with a Platform Binding (e.g. GLFW)
3
-
// (Please note that WebGPU is currently experimental, will not run on non-beta browsers, and may break.)
2
+
// This needs to be used along with a Platform Binding (e.g. GLFW, SDL2, SDL3)
3
+
// (Please note that WebGPU is a recent API, may not be supported by all browser, and its ecosystem is generally a mess)
4
4
5
5
// Implemented features:
6
6
// [X] Renderer: User texture binding. Use 'WGPUTextureView' as ImTextureID. Read the FAQ about ImTextureID/ImTextureRef!
7
7
// [X] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset).
8
8
// [X] Renderer: Expose selected render state for draw callbacks to use. Access in '(ImGui_ImplXXXX_RenderState*)GetPlatformIO().Renderer_RenderState'.
9
9
// [X] Renderer: Texture updates support for dynamic font system (ImGuiBackendFlags_RendererHasTextures).
10
10
11
+
// Read imgui_impl_wgpu.h about how to use the IMGUI_IMPL_WEBGPU_BACKEND_WGPU or IMGUI_IMPL_WEBGPU_BACKEND_DAWN flags.
12
+
11
13
// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this.
12
14
// Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need.
13
15
// Learn about Dear ImGui:
@@ -18,6 +20,7 @@
18
20
19
21
// CHANGELOG
20
22
// (minor and older changes stripped away, please see git history for details)
23
+
// 2025-10-16: Update to compile with Dawn and Emscripten's 4.0.10+ '--use-port=emdawnwebgpu' ports. (#8381, #8898)
21
24
// 2025-09-18: Call platform_io.ClearRendererHandlers() on shutdown.
22
25
// 2025-06-12: Added support for ImGuiBackendFlags_RendererHasTextures, for dynamic font atlas. (#8465)
23
26
// 2025-02-26: Recreate image bind groups during render. (#8426, #8046, #7765, #8027) + Update for latest webgpu-native changes.
@@ -46,20 +49,20 @@
46
49
47
50
#include"imgui.h"
48
51
49
-
// When targeting native platforms (i.e. NOT Emscripten), one of IMGUI_IMPL_WEBGPU_BACKEND_DAWN
50
-
// or IMGUI_IMPL_WEBGPU_BACKEND_WGPU must be provided. See imgui_impl_wgpu.h for more details.
Copy file name to clipboardExpand all lines: backends/imgui_impl_wgpu.h
+18-5Lines changed: 18 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,14 @@
1
1
// dear imgui: Renderer for WebGPU
2
-
// This needs to be used along with a Platform Binding (e.g. GLFW)
3
-
// (Please note that WebGPU is currently experimental, will not run on non-beta browsers, and may break.)
2
+
// This needs to be used along with a Platform Binding (e.g. GLFW, SDL2, SDL3)
3
+
// (Please note that WebGPU is a recent API, may not be supported by all browser, and its ecosystem is generally a mess)
4
4
5
-
// Important note to dawn and/or wgpu users: when targeting native platforms (i.e. NOT emscripten),
6
-
// one of IMGUI_IMPL_WEBGPU_BACKEND_DAWN or IMGUI_IMPL_WEBGPU_BACKEND_WGPU must be provided.
5
+
// When targeting native platforms:
6
+
// - One of IMGUI_IMPL_WEBGPU_BACKEND_DAWN or IMGUI_IMPL_WEBGPU_BACKEND_WGPU *must* be provided.
7
+
// When targeting Emscripten:
8
+
// - We now defaults to IMGUI_IMPL_WEBGPU_BACKEND_DAWN is Emscripten version is 4.0.10+, which correspond to using Emscripten '--use-port=emdawnwebgpu'.
9
+
// - We can still define IMGUI_IMPL_WEBGPU_BACKEND_WGPU to use Emscripten '-s USE_WEBGPU=1' which is marked as obsolete by Emscripten.
7
10
// Add #define to your imconfig.h file, or as a compilation flag in your build system.
8
-
// This requirement will be removed once WebGPU stabilizes and backends converge on a unified interface.
11
+
// This requirement may be removed once WebGPU stabilizes and backends converge on a unified interface.
0 commit comments