Skip to content

Commit

Permalink
deps: update ImGUI to v1.90.3 (#492)
Browse files Browse the repository at this point in the history
Updating ImGUI to v1.90.3.
Requires 2 small changes:
 - removed not unnecessary calls to the FontsTexture functions.
 - changed the setup for dynamic rendering.

Signed-off-by: Nathan Gauër <[email protected]>
  • Loading branch information
Keenuts authored Jul 18, 2024
1 parent 693cac0 commit 850b143
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
18 changes: 8 additions & 10 deletions src/ppx/imgui_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,17 +271,21 @@ Result ImGuiImplVk::InitApiObjects(ppx::Application* pApp)
init_info.ImageCount = pApp->GetUISwapchain()->GetImageCount();
init_info.Allocator = VK_NULL_HANDLE;
init_info.CheckVkResultFn = nullptr;
#if IMGUI_VERSION_NUM > 18970
init_info.UseDynamicRendering = pApp->GetSettings()->grfx.enableImGuiDynamicRendering;
init_info.ColorAttachmentFormat = grfx::vk::ToVkFormat(pApp->GetUISwapchain()->GetColorFormat());
#if (IMGUI_VERSION_NUM > 18970) && defined(IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING)
init_info.UseDynamicRendering = pApp->GetSettings()->grfx.enableImGuiDynamicRendering;
init_info.PipelineRenderingCreateInfo = {VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO};
VkFormat colorFormat = grfx::vk::ToVkFormat(pApp->GetUISwapchain()->GetColorFormat());
init_info.PipelineRenderingCreateInfo.colorAttachmentCount = 1;
init_info.PipelineRenderingCreateInfo.pColorAttachmentFormats = &colorFormat;
#else
PPX_ASSERT_MSG(!pApp->GetSettings()->grfx.enableImGuiDynamicRendering, "This version of ImGui does not have dynamic rendering support");
#endif

grfx::RenderPassPtr renderPass = pApp->GetUISwapchain()->GetRenderPass(0, grfx::ATTACHMENT_LOAD_OP_LOAD);
PPX_ASSERT_MSG(!renderPass.IsNull(), "[imgui:vk] failed to get swapchain renderpass");

bool result = ImGui_ImplVulkan_Init(&init_info, grfx::vk::ToApi(renderPass)->GetVkRenderPass());
init_info.RenderPass = grfx::vk::ToApi(renderPass)->GetVkRenderPass();
bool result = ImGui_ImplVulkan_Init(&init_info);
if (!result) {
return ppx::ERROR_IMGUI_INITIALIZATION_FAILED;
}
Expand All @@ -304,9 +308,6 @@ Result ImGuiImplVk::InitApiObjects(ppx::Application* pApp)
return ppxres;
}

// Create fonts texture
ImGui_ImplVulkan_CreateFontsTexture(grfx::vk::ToApi(commandBuffer)->GetVkCommandBuffer());

// End command buffer
ppxres = commandBuffer->End();
if (Failed(ppxres)) {
Expand Down Expand Up @@ -334,9 +335,6 @@ Result ImGuiImplVk::InitApiObjects(ppx::Application* pApp)

// Destroy command buffer
pApp->GetGraphicsQueue()->DestroyCommandBuffer(commandBuffer);

// Destroy font upload objects
ImGui_ImplVulkan_DestroyFontUploadObjects();
}

return ppx::SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion third_party/imgui
Submodule imgui updated 89 files
+1 −0 .github/ISSUE_TEMPLATE/config.yml
+90 −0 .github/ISSUE_TEMPLATE/issue_template.yml
+0 −46 .github/issue_template.md
+7 −7 .github/workflows/build.yml
+1 −1 .github/workflows/static-analysis.yml
+1 −1 LICENSE.txt
+9 −6 backends/imgui_impl_allegro5.cpp
+5 −2 backends/imgui_impl_allegro5.h
+17 −12 backends/imgui_impl_android.cpp
+6 −3 backends/imgui_impl_android.h
+8 −5 backends/imgui_impl_dx10.cpp
+5 −2 backends/imgui_impl_dx10.h
+8 −5 backends/imgui_impl_dx11.cpp
+5 −2 backends/imgui_impl_dx11.h
+8 −5 backends/imgui_impl_dx12.cpp
+5 −2 backends/imgui_impl_dx12.h
+30 −5 backends/imgui_impl_dx9.cpp
+5 −2 backends/imgui_impl_dx9.h
+66 −9 backends/imgui_impl_glfw.cpp
+10 −2 backends/imgui_impl_glfw.h
+5 −2 backends/imgui_impl_glut.cpp
+5 −2 backends/imgui_impl_glut.h
+5 −2 backends/imgui_impl_metal.h
+8 −5 backends/imgui_impl_metal.mm
+9 −6 backends/imgui_impl_opengl2.cpp
+5 −2 backends/imgui_impl_opengl2.h
+37 −23 backends/imgui_impl_opengl3.cpp
+5 −2 backends/imgui_impl_opengl3.h
+14 −7 backends/imgui_impl_opengl3_loader.h
+5 −2 backends/imgui_impl_osx.h
+20 −16 backends/imgui_impl_osx.mm
+151 −54 backends/imgui_impl_sdl2.cpp
+10 −5 backends/imgui_impl_sdl2.h
+178 −72 backends/imgui_impl_sdl3.cpp
+11 −2 backends/imgui_impl_sdl3.h
+10 −6 backends/imgui_impl_sdlrenderer2.cpp
+8 −0 backends/imgui_impl_sdlrenderer2.h
+13 −10 backends/imgui_impl_sdlrenderer3.cpp
+8 −0 backends/imgui_impl_sdlrenderer3.h
+245 −161 backends/imgui_impl_vulkan.cpp
+38 −16 backends/imgui_impl_vulkan.h
+54 −26 backends/imgui_impl_wgpu.cpp
+23 −3 backends/imgui_impl_wgpu.h
+44 −5 backends/imgui_impl_win32.cpp
+5 −2 backends/imgui_impl_win32.h
+407 −3 docs/CHANGELOG.txt
+2 −2 docs/EXAMPLES.md
+6 −11 docs/FAQ.md
+62 −32 docs/FONTS.md
+17 −15 docs/README.md
+1 −2 docs/TODO.txt
+6 −2 examples/example_allegro5/main.cpp
+6 −1 examples/example_android_opengl3/main.cpp
+6 −2 examples/example_apple_metal/main.mm
+6 −2 examples/example_apple_opengl2/main.mm
+0 −0 examples/example_emscripten_wgpu/Makefile.emscripten
+1 −1 examples/example_emscripten_wgpu/README.md
+169 −138 examples/example_emscripten_wgpu/main.cpp
+2 −2 examples/example_glfw_metal/Makefile
+6 −2 examples/example_glfw_metal/main.mm
+6 −2 examples/example_glfw_opengl2/main.cpp
+1 −1 examples/example_glfw_opengl3/Makefile.emscripten
+9 −2 examples/example_glfw_opengl3/main.cpp
+18 −43 examples/example_glfw_vulkan/main.cpp
+6 −2 examples/example_glut_opengl2/main.cpp
+12 −2 examples/example_sdl2_directx11/main.cpp
+6 −2 examples/example_sdl2_metal/main.mm
+12 −2 examples/example_sdl2_opengl2/main.cpp
+12 −2 examples/example_sdl2_opengl3/main.cpp
+11 −2 examples/example_sdl2_sdlrenderer2/main.cpp
+23 −43 examples/example_sdl2_vulkan/main.cpp
+7 −3 examples/example_sdl3_opengl3/main.cpp
+9 −5 examples/example_sdl3_sdlrenderer3/main.cpp
+6 −2 examples/example_win32_directx10/main.cpp
+6 −2 examples/example_win32_directx11/main.cpp
+6 −2 examples/example_win32_directx12/main.cpp
+6 −2 examples/example_win32_directx9/main.cpp
+14 −10 examples/example_win32_opengl3/main.cpp
+5 −3 imconfig.h
+1,445 −718 imgui.cpp
+395 −303 imgui.h
+383 −118 imgui_demo.cpp
+130 −50 imgui_draw.cpp
+434 −203 imgui_internal.h
+298 −91 imgui_tables.cpp
+524 −214 imgui_widgets.cpp
+76 −72 imstb_textedit.h
+22 −14 misc/freetype/imgui_freetype.cpp
+1 −2 misc/freetype/imgui_freetype.h

0 comments on commit 850b143

Please sign in to comment.