@ -22,6 +22,7 @@
// CHANGELOG
// (minor and older changes stripped away, please see git history for details)
// 2020-11-11: Vulkan: Added support for specifying which subpass to reference during VkPipeline creation.
// 2020-09-07: Vulkan: Added VkPipeline parameter to ImGui_ImplVulkan_RenderDrawData (default to one passed to ImGui_ImplVulkan_Init).
// 2020-05-04: Vulkan: Fixed crash if initial frame has no vertices.
// 2020-04-26: Vulkan: Fixed edge case where render callbacks wouldn't be called if the ImDrawData didn't have vertices.
@ -81,6 +82,7 @@ static VkDescriptorSetLayout g_DescriptorSetLayout = VK_NULL_HANDLE;
static VkPipelineLayout g_PipelineLayout = VK_NULL_HANDLE ;
static VkDescriptorSet g_DescriptorSet = VK_NULL_HANDLE ;
static VkPipeline g_Pipeline = VK_NULL_HANDLE ;
static uint32_t g_Subpass = 0 ;
static VkShaderModule g_ShaderModuleVert ;
static VkShaderModule g_ShaderModuleFrag ;
@ -675,7 +677,7 @@ static void ImGui_ImplVulkan_CreatePipelineLayout(VkDevice device, const VkAlloc
check_vk_result ( err ) ;
}
static void ImGui_ImplVulkan_CreatePipeline ( VkDevice device , const VkAllocationCallbacks * allocator , VkPipelineCache pipelineCache , VkRenderPass renderPass , VkSampleCountFlagBits MSAASamples , VkPipeline * pipeline )
static void ImGui_ImplVulkan_CreatePipeline ( VkDevice device , const VkAllocationCallbacks * allocator , VkPipelineCache pipelineCache , VkRenderPass renderPass , VkSampleCountFlagBits MSAASamples , VkPipeline * pipeline , uint32_t subpass )
{
ImGui_ImplVulkan_CreateShaderModules ( device , allocator ) ;
@ -775,6 +777,7 @@ static void ImGui_ImplVulkan_CreatePipeline(VkDevice device, const VkAllocationC
info . pDynamicState = & dynamic_state ;
info . layout = g_PipelineLayout ;
info . renderPass = renderPass ;
info . subpass = subpass ;
VkResult err = vkCreateGraphicsPipelines ( device , pipelineCache , 1 , & info , allocator , pipeline ) ;
check_vk_result ( err ) ;
}
@ -846,7 +849,7 @@ bool ImGui_ImplVulkan_CreateDeviceObjects()
check_vk_result ( err ) ;
}
ImGui_ImplVulkan_CreatePipeline ( v - > Device , v - > Allocator , v - > PipelineCache , g_RenderPass , v - > MSAASamples , & g_Pipeline );
ImGui_ImplVulkan_CreatePipeline ( v - > Device , v - > Allocator , v - > PipelineCache , g_RenderPass , v - > MSAASamples , & g_Pipeline , g_Subpass );
return true ;
}
@ -901,6 +904,8 @@ bool ImGui_ImplVulkan_Init(ImGui_ImplVulkan_InitInfo* info, VkRenderPass rend
g_VulkanInitInfo = * info ;
g_RenderPass = render_pass ;
g_Subpass = info - > Subpass ;
ImGui_ImplVulkan_CreateDeviceObjects ( ) ;
return true ;
@ -1193,7 +1198,7 @@ void ImGui_ImplVulkanH_CreateWindowSwapChain(VkPhysicalDevice physical_device, V
// We do not create a pipeline by default as this is also used by examples' main.cpp,
// but secondary viewport in multi-viewport mode may want to create one with:
//ImGui_ImplVulkan_CreatePipeline(device, allocator, VK_NULL_HANDLE, wd->RenderPass, VK_SAMPLE_COUNT_1_BIT, &wd->Pipeline );
//ImGui_ImplVulkan_CreatePipeline(device, allocator, VK_NULL_HANDLE, wd->RenderPass, VK_SAMPLE_COUNT_1_BIT, &wd->Pipeline , g_Subpass );
}
// Create The Image Views