Skip to content

Commit 1f020e5

Browse files
committed
Backends: Vulkan: ImGui_ImplVulkan_CreatePipeline() for secondary viewport always use the RenderPass created by the ImGui_ImplVulkanH_CreateOrResizeWindow(). (#8946, #8110)
1 parent bad3c14 commit 1f020e5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

backends/imgui_impl_vulkan.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,8 +1322,6 @@ bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info)
13221322
IM_ASSERT(info->DescriptorPoolSize > 0);
13231323
if (info->UseDynamicRendering)
13241324
IM_ASSERT(info->PipelineInfoMain.RenderPass == VK_NULL_HANDLE && info->PipelineInfoForViewports.RenderPass == VK_NULL_HANDLE);
1325-
else if (info->PipelineInfoForViewports.RenderPass == NULL)
1326-
info->PipelineInfoForViewports.RenderPass = info->PipelineInfoMain.RenderPass;
13271325

13281326
bd->VulkanInitInfo = *info;
13291327

@@ -2014,7 +2012,7 @@ static void ImGui_ImplVulkan_CreateWindow(ImGuiViewport* viewport)
20142012
}
20152013
else
20162014
{
2017-
IM_ASSERT(pipeline_info->RenderPass != VK_NULL_HANDLE && "Did you set ImGui_ImplVulkan_InitInfo::PipelineInfoForViewports.RenderPass?"); // Since 1.92.4 it is required.
2015+
pipeline_info->RenderPass = wd->RenderPass;
20182016
}
20192017
#endif
20202018
bd->PipelineForViewports = ImGui_ImplVulkan_CreatePipeline(v->Device, v->Allocator, VK_NULL_HANDLE, &v->PipelineInfoForViewports);

backends/imgui_impl_vulkan.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,10 @@
6969
// Specify settings to create pipeline and swapchain
7070
struct ImGui_ImplVulkan_PipelineInfo
7171
{
72-
// For Main and Secondary viewports
72+
// For Main viewport only
7373
VkRenderPass RenderPass; // Ignored if using dynamic rendering
74+
75+
// For Main and Secondary viewports
7476
uint32_t Subpass; //
7577
VkSampleCountFlagBits MSAASamples = {}; // 0 defaults to VK_SAMPLE_COUNT_1_BIT
7678
#ifdef IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING

0 commit comments

Comments
 (0)