Skip to content

Vulkan: Re-create main window pipeline (standalone) #8110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SuperRonan
Copy link

This is a standalone PR (from #8053, solve one problem at the time) to just recreate the main window pipeline when one of its properties changes (RenderPass / pDynamicRendering, MSAASamples, ...), but without any color correction (the colors might look off depending on the render target format / swapchain color space if directly forwarded to be presented).

A docking version is comming soon (without color correction).

API changes:

  • Added ImGui_ImplVulkan_ReCreateMainPipeline(...) to explicitly re-create the main window pipeline (when some of its properties are changed).
  • ImGui_ImplVulkan_CreatePipeline(...) does not implicitly use ImGui_ImplVulkan_InitInfo::PipelineRenderingCreateInfo, but a function parameter.
  • The main window pipeline is created only if possible during ImGui_ImplVulkan_Init(...) (if a render pass or rendering info are given), else it should be created with ImGui_ImplVulkan_ReCreateMainPipeline(...) before rendering)

- Added ImGui_ImplVulkan_ReCreateMainPipeline(...) to explicitly re-create the main window pipeline (when some of its properties are changed).
- ImGui_ImplVulkan_ReCreateMainPipeline(...) does not implicitly use ImGui_ImplVulkan_InitInfo::PipelineRenderingCreateInfo, but a function parameter.
- The main window pipeline is created only if possible during ImGui_ImplVulkan_Init(...) (if a render pass or rendering info are given), else it should be created with ImGui_ImplVulkan_ReCreateMainPipeline(...)
- ImGui_ImplVulkan_CreatePipeline now takes a struct rather than (too) many parameters (and returns the created pipeline).
@ocornut
Copy link
Owner

ocornut commented Aug 11, 2025

Sorry this is still too complex for me to follow.

Can you:

  • [1] Clarify how and when to use this (perhaps a commit to an example would be good)
  • [2] Why is creation code in the ImGui_ImplVulkan_Init() function and not in ImGui_ImplVulkan_CreateDeviceObjects() ?
  • [3] Can you explain the logic/need to allow v->PipelineRenderingCreateInfo.sType != VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR) when dynamic rendering is used? It was previously required? It is as a convenience to allow the user to create pipeline later than Init?
  • [4] Could ImGui_ImplVulkan_PipelineRenderingInfo either be renamed to ImGui_ImplVulkan_PipelineRenderingCreateInfo to match VkPipelineRenderingCreateInfoKHR, or ideally removed? Maybe ifndef IMGUI_IMPL_VULKAN_HAS_DYNAMIC_RENDERING then we use typedef void VkPipelineRenderingCreateInfoKHR directly?
  • [5] What is IMGUI_IMPL_VULKAN_HAS_MAIN_PIPELINE_RE_CREATION for?
  • [6] Why commenting out //if (info->UseDynamicRendering == false) IM_ASSERT(info->RenderPass != VK_NULL_HANDLE); ?
  • [7] It feels like the struct ImGui_ImplVulkan_MainPipelineCreateInfo is superfluous and those could be parameters to ImGui_ImplVulkan_ReCreateMainPipeline().
  • [8] Likewise for ImGui_ImplVulkan_PipelineCreateInfo. Not in principle against using struct, and I agree they tends to play better in term of long-term API design, but this one is specifically an internal only API so it doesn't matter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants