mirror of
https://github.com/ocornut/imgui.git
synced 2026-03-09 18:45:46 +00:00
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:
@@ -33,12 +33,21 @@
|
|||||||
// Setup Emscripten default if not specified.
|
// Setup Emscripten default if not specified.
|
||||||
#if defined(__EMSCRIPTEN__) && !defined(IMGUI_IMPL_WEBGPU_BACKEND_DAWN) && !defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU)
|
#if defined(__EMSCRIPTEN__) && !defined(IMGUI_IMPL_WEBGPU_BACKEND_DAWN) && !defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU)
|
||||||
#include <emscripten/version.h>
|
#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)
|
#if (__EMSCRIPTEN_major__ >= 4) && (__EMSCRIPTEN_minor__ >= 0) && (__EMSCRIPTEN_tiny__ >= 10)
|
||||||
#define IMGUI_IMPL_WEBGPU_BACKEND_DAWN
|
#define IMGUI_IMPL_WEBGPU_BACKEND_DAWN
|
||||||
#else
|
#else
|
||||||
#define IMGUI_IMPL_WEBGPU_BACKEND_WGPU
|
#define IMGUI_IMPL_WEBGPU_BACKEND_WGPU
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <webgpu/webgpu.h>
|
#include <webgpu/webgpu.h>
|
||||||
#if defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU) && !defined(__EMSCRIPTEN__)
|
#if defined(IMGUI_IMPL_WEBGPU_BACKEND_WGPU) && !defined(__EMSCRIPTEN__)
|
||||||
|
|||||||
@@ -259,6 +259,7 @@ Other Changes:
|
|||||||
selects `VkSwapchainCreateInfoKHR`'s `compositeAlpha` value based on
|
selects `VkSwapchainCreateInfoKHR`'s `compositeAlpha` value based on
|
||||||
`cap.supportedCompositeAlpha`, which seems to be required on some Android
|
`cap.supportedCompositeAlpha`, which seems to be required on some Android
|
||||||
devices. (#8784) [@FelixStach]
|
devices. (#8784) [@FelixStach]
|
||||||
|
- WebGPU: fixes for Emscripten 5.0.0 (note: our examples currently don't build with 5.0.1).
|
||||||
- Win32: handle `WM_IME_CHAR`/`WM_IME_COMPOSITION` to support Unicode inputs on
|
- Win32: handle `WM_IME_CHAR`/`WM_IME_COMPOSITION` to support Unicode inputs on
|
||||||
MBCS (non-Unicode) Windows. (#9099, #3653, #5961) [@ulhc, @ocornut, @Othereum]
|
MBCS (non-Unicode) Windows. (#9099, #3653, #5961) [@ulhc, @ocornut, @Othereum]
|
||||||
- Win32: minor optimization not submitting gamepad input if packet number has not
|
- Win32: minor optimization not submitting gamepad input if packet number has not
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ static int wgpu_surface_width = 1280;
|
|||||||
static int wgpu_surface_height = 800;
|
static int wgpu_surface_height = 800;
|
||||||
|
|
||||||
// Forward declarations
|
// Forward declarations
|
||||||
static bool InitWGPU(GLFWwindow* window);
|
static bool InitWGPU(GLFWwindow* window);
|
||||||
static WGPUSurface CreateWGPUSurface(const WGPUInstance& instance, GLFWwindow* window);
|
WGPUSurface CreateWGPUSurface(const WGPUInstance& instance, GLFWwindow* window);
|
||||||
|
|
||||||
static void glfw_error_callback(int error, const char* description)
|
static void glfw_error_callback(int error, const char* description)
|
||||||
{
|
{
|
||||||
@@ -408,7 +408,7 @@ static WGPUDevice RequestDevice(WGPUAdapter& adapter)
|
|||||||
#endif // __EMSCRIPTEN__
|
#endif // __EMSCRIPTEN__
|
||||||
#endif // IMGUI_IMPL_WEBGPU_BACKEND_WGPU
|
#endif // IMGUI_IMPL_WEBGPU_BACKEND_WGPU
|
||||||
|
|
||||||
static bool InitWGPU(GLFWwindow* window)
|
bool InitWGPU(GLFWwindow* window)
|
||||||
{
|
{
|
||||||
WGPUTextureFormat preferred_fmt = WGPUTextureFormat_Undefined; // acquired from SurfaceCapabilities
|
WGPUTextureFormat preferred_fmt = WGPUTextureFormat_Undefined; // acquired from SurfaceCapabilities
|
||||||
|
|
||||||
|
|||||||
@@ -40,8 +40,8 @@ static int wgpu_surface_width = 1280;
|
|||||||
static int wgpu_surface_height = 800;
|
static int wgpu_surface_height = 800;
|
||||||
|
|
||||||
// Forward declarations
|
// Forward declarations
|
||||||
static bool InitWGPU(SDL_Window* window);
|
static bool InitWGPU(SDL_Window* window);
|
||||||
static WGPUSurface CreateWGPUSurface(const WGPUInstance& instance, SDL_Window* window);
|
WGPUSurface CreateWGPUSurface(const WGPUInstance& instance, SDL_Window* window);
|
||||||
|
|
||||||
static void ResizeSurface(int width, int height)
|
static void ResizeSurface(int width, int height)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user