From e6525273131dca258fe36347a584b078147b8077 Mon Sep 17 00:00:00 2001 From: Corentin Wallez Date: Tue, 24 Aug 2021 13:48:04 +0100 Subject: [PATCH] Backends: WebGPU: Update impl_wgpu for an emscripten change --- backends/imgui_impl_wgpu.cpp | 7 ++++--- docs/CHANGELOG.txt | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/backends/imgui_impl_wgpu.cpp b/backends/imgui_impl_wgpu.cpp index 473154c5..a5c9eb55 100644 --- a/backends/imgui_impl_wgpu.cpp +++ b/backends/imgui_impl_wgpu.cpp @@ -6,13 +6,14 @@ // [X] Renderer: User texture binding. Use 'WGPUTextureView' as ImTextureID. Read the FAQ about ImTextureID! // [X] Renderer: Support for large meshes (64k+ vertices) with 16-bit indices. -// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. +// You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. // Read online: https://github.com/ocornut/imgui/tree/master/docs // CHANGELOG // (minor and older changes stripped away, please see git history for details) +// 2021-08-24: Fix for latest specs. // 2021-05-24: Add support for draw_data->FramebufferScale. // 2021-05-19: Replaced direct access to ImDrawCmd::TextureId with a call to ImDrawCmd::GetTexID(). (will become a requirement) // 2021-05-16: Update to latest WebGPU specs (compatible with Emscripten 2.0.20 and Chrome Canary 92). @@ -544,7 +545,7 @@ bool ImGui_ImplWGPU_CreateDeviceObjects() ImGui_ImplWGPU_InvalidateDeviceObjects(); // Create render pipeline - WGPURenderPipelineDescriptor2 graphics_pipeline_desc = {}; + WGPURenderPipelineDescriptor graphics_pipeline_desc = {}; graphics_pipeline_desc.primitive.topology = WGPUPrimitiveTopology_TriangleList; graphics_pipeline_desc.primitive.stripIndexFormat = WGPUIndexFormat_Undefined; graphics_pipeline_desc.primitive.frontFace = WGPUFrontFace_CW; @@ -610,7 +611,7 @@ bool ImGui_ImplWGPU_CreateDeviceObjects() // Configure disabled depth-stencil state graphics_pipeline_desc.depthStencil = nullptr; - g_pipelineState = wgpuDeviceCreateRenderPipeline2(g_wgpuDevice, &graphics_pipeline_desc); + g_pipelineState = wgpuDeviceCreateRenderPipeline(g_wgpuDevice, &graphics_pipeline_desc); ImGui_ImplWGPU_CreateFontsTexture(); ImGui_ImplWGPU_CreateUniformBuffer(); diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 60c01ab4..c9fc435a 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -46,7 +46,8 @@ Other Changes: the whole widget is clipped. - imgui_freetype: Fixed crash when FT_Render_Glyph() fails to render a glyph and returns NULL (which apparently happens with Freetype 2.11). (#4394, #4145?). -- Backends: OpenGL3: Fix our new GL loader conflicting with user using GL3W. (#4445) +- Backends: OpenGL3: Fixed our new GL loader conflicting with user using GL3W. (#4445) +- Backends: WebGPU: Fixed for latest specs. (#4472) [@Kangz] -----------------------------------------------------------------------