Backends: Vulkan: Support for dynamic_rendering#5037
Backends: Vulkan: Support for dynamic_rendering#5037spnda wants to merge 1 commit intoocornut:masterfrom
Conversation
3862d88 to
de64059
Compare
|
Hello, Thanks for the PR. In particular, Thanks! |
|
Hello @ocornut, |
|
Any of the examples where the ViewportEnable configuration flag is set will demonstrate use of multi-viewports.
See wiki https://github.com/ocornut/imgui/wiki/Multi-Viewports for a description of that feature.
|
|
Took me a few hours but I got a master build of MoltenVK to run on this Mac and managed to get the example_glfw_vulkan with some minor modifications so that it uses this feature to work, and I guess this looks correct? I also pushed a small edit, but I want to make a few changes first. Hang tight :) |
|
Ok @ocornut this is good to go now. If you want to see what I changed in the example (or perhaps want a new one in this repo?), see here: spnda@3ffcea4. |
|
When I try to run this it fails when I try to drag an imgui window, with the validation error in |
|
Also @ocornut, any updates on merge status for this PR? |
|
Hello @spnda, sorry i was waiting on a commit for docking. Could you open or rework this PR over |
Co-authored-by: Caio Oliveira <[email protected]> Simplified for master branch. # Conflicts: # backends/imgui_impl_vulkan.cpp
|
For reference, attached is the patch to enable dynamic rendering in GLFW+Vulkan's main.cpp: imgui-5ac7227-Examples GLFW+Vulkan Add compile-time flag to use Dynamic Rendering (5446).patch |

With the
VK_KHR_dynamic_renderingextension Vulkan received a whole new way of how to rasterize. In the end, it got rid ofVkRenderPassandVkFramebuffer, which is the reason for me opening this PR. Developers who want to utilize the new extension, which also got made core in Vulkan 1.3, and are attempting to use its functionality would have to fallback to the oldVkRenderPassandVkFramebuffersystem, effectively being unable to utilize anything new.With this PR, one can set a boolean in the
ImGui_ImplVulkan_InitInfostruct while initializing the backend so that it does not require a validVkRenderPassto be passed intoImGui_ImplVulkan_Init. The new dynamic_rendering functionality only requires an attachment format, which is the reasoning for the newColorAttachmentFormatmember in theImGui_ImplVulkan_InitInfostruct. This value is used while creating the pipeline instead of the render pass. The color format is allowed to be0, orVK_FORMAT_UNDEFINED, which is why I do not assert there. The application developer is also responsible for checking if the extension is present or if the device supports Vulkan 1.3.