From 1f020e526afaf0143104fe1acf66e27a12a94e40 Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 29 Sep 2025 15:06:58 +0200 Subject: [PATCH] Backends: Vulkan: ImGui_ImplVulkan_CreatePipeline() for secondary viewport always use the RenderPass created by the ImGui_ImplVulkanH_CreateOrResizeWindow(). (#8946, #8110) --- backends/imgui_impl_vulkan.cpp | 4 +--- backends/imgui_impl_vulkan.h | 4 +++- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backends/imgui_impl_vulkan.cpp b/backends/imgui_impl_vulkan.cpp index f20a9064a..95e7d06de 100644 --- a/backends/imgui_impl_vulkan.cpp +++ b/backends/imgui_impl_vulkan.cpp @@ -1322,8 +1322,6 @@ bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info) IM_ASSERT(info->DescriptorPoolSize > 0); if (info->UseDynamicRendering) IM_ASSERT(info->PipelineInfoMain.RenderPass == VK_NULL_HANDLE && info->PipelineInfoForViewports.RenderPass == VK_NULL_HANDLE); - else if (info->PipelineInfoForViewports.RenderPass == NULL) - info->PipelineInfoForViewports.RenderPass = info->PipelineInfoMain.RenderPass; bd->VulkanInitInfo = *info; @@ -2014,7 +2012,7 @@ static void ImGui_ImplVulkan_CreateWindow(ImGuiViewport* viewport) } else { - IM_ASSERT(pipeline_info->RenderPass != VK_NULL_HANDLE && "Did you set ImGui_ImplVulkan_InitInfo::PipelineInfoForViewports.RenderPass?"); // Since 1.92.4 it is required. + pipeline_info->RenderPass = wd->RenderPass; } #endif bd->PipelineForViewports = ImGui_ImplVulkan_CreatePipeline(v->Device, v->Allocator, VK_NULL_HANDLE, &v->PipelineInfoForViewports); diff --git a/backends/imgui_impl_vulkan.h b/backends/imgui_impl_vulkan.h index 544f7f162..ad89cb9e4 100644 --- a/backends/imgui_impl_vulkan.h +++ b/backends/imgui_impl_vulkan.h @@ -69,8 +69,10 @@ // Specify settings to create pipeline and swapchain struct ImGui_ImplVulkan_PipelineInfo { - // For Main and Secondary viewports + // For Main viewport only VkRenderPass RenderPass; // Ignored if using dynamic rendering + + // For Main and Secondary viewports uint32_t Subpass; // VkSampleCountFlagBits MSAASamples = {}; // 0 defaults to VK_SAMPLE_COUNT_1_BIT #ifdef IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING