Backends: WebGPU: minor build fix for Emscripten 5.0.0 (note: our examples currently don't build with 5.0.1).

Getting 'warning: unused function 'CreateWGPUSurface' [-Wunused-function]' in some build paths.
cc #9246
This commit is contained in:
ocornut
2026-02-16 18:04:20 +01:00
parent acdaaef625
commit ff673d31df
4 changed files with 15 additions and 5 deletions
+9
View File
@@ -33,12 +33,21 @@
// Setup Emscripten default if not specified.
#if defined(__EMSCRIPTEN__) && !defined(IMGUI_IMPL_WEBGPU_BACKEND_DAWN) && !defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU)
#include <emscripten/version.h>
#ifdef __EMSCRIPTEN_MAJOR__
#if (__EMSCRIPTEN_MAJOR__ >= 4) && (__EMSCRIPTEN_MINOR__ >= 0) && (__EMSCRIPTEN_TINY__ >= 10)
#define IMGUI_IMPL_WEBGPU_BACKEND_DAWN
#else
#define IMGUI_IMPL_WEBGPU_BACKEND_WGPU
#endif
#else
#if (__EMSCRIPTEN_major__ >= 4) && (__EMSCRIPTEN_minor__ >= 0) && (__EMSCRIPTEN_tiny__ >= 10)
#define IMGUI_IMPL_WEBGPU_BACKEND_DAWN
#else
#define IMGUI_IMPL_WEBGPU_BACKEND_WGPU
#endif
#endif
#endif
#include <webgpu/webgpu.h>
#if defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU) && !defined(__EMSCRIPTEN__)