Skip to content
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

Vulkan: Control secondary viewports format and present mode #8061

Draft
wants to merge 5 commits into
base: docking
Choose a base branch
from

Conversation

SuperRonan
Copy link

API changes:
See the pull request for the master branch for the changes concerning the main window pipeline re-creation and addition of color correction. This PR extends these new features to ImGui's secondary viewports.

  1. Concerning multi view ports:
  • Secondary viewports surface format and present mode can now be controlled by the application via ImGui_ImplVulkan_RequestSecondaryViewportsChanges(...)
  • Secondary viewports can also use color correction if they use the application requested format.
  • Each viewport now has its own VkRenderPass and VkPipeline (cached and shared in the backed data). This fits to the fact that each viewport might have a different format (the previous code was making the (quite reasonable) assumption that they all share the same format).
  • Recycle some viewport resource on swapchain recreation if possible (CommandPool, CommandBuffer, Fence, Semaphores) rather than recreating them every time.

…ction in the fragment shader

API changes:
- Added ImGui_ImplVulkan_ReCreateMainPipeline(...) to explicitly re-create the main window pipeline (when some of its properties are changed).
- ImGui_ImplVulkan_CreateMainPipeline(...) 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)
Concerning color correction:
- The default behavior of imgui_impl_vulkan does not change (no color correction is applied).
- A color correction method is decided at pipeline compile time (through a vulkan specialization constant)
- Color correction parameters can either be set at pipeline compile time (static mode), or through push_constant (dynamic mode, default)
- A gamma correction mode is implemented (and an extra alpha gamma correction).
- New color modes can easily be added.
Concerning multi view ports:
- Secondary viewports surface format and present mode can now be controlled by the application view ImGui_ImplVulkan_RequestSecondaryViewportsChanges(...)
- Secondary viewports can also use color correction if they use the application requested format.
- Each viewport now has its own VkRenderPass and VkPipeline (cached in the backed data). This fits to the fact that each viewport might have a different format (the previous code was making this (quite reasonable) assumption).
- Recycle some viewport resource on swapchain recreation if possible (CommandPool, CommandBuffer, Fence, Semaphores) rather than recreating them every time.
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