-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
Added SDL3 Vulkan Example with docking + fixed a multi-viewport bug with SDL3 #8085
Added SDL3 Vulkan Example with docking + fixed a multi-viewport bug with SDL3 #8085
Conversation
…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.
… not working yet!)
…HighDPI flag from the main window.
I made a branch on my fork with only the commit that fixes the SDL3 bug, maybe I should do a PR of it separately? |
I made a standalone PR for fix: #8098 |
Thanks Ronan for those PR. Please see my comment #8041 (comment) I am unlikely to be able to look at any PR with multiple unrelated changes, it's a little too difficult for Vulkan backend. The current state of this is unfortunately "100% won't merge". If I cannot review, I cannot merge :( But you can use interface rebase to squash and recreate suitable history.
Thank you! |
I have pushed a SDL3+Vulkan example ccb6646 which I've recreated by copying example_sdl2_vulkan then manually looking at the diff between example_sdl2_opengl3 and example_sdl3_opengl3, and applying a few other fixes. I'm merging this in This likely to unfortunately conflicts with your two similar commits. I suggest that you:
|
It looks like you integrated the changes in 646df39, so I can close this PR. |
I honestly don't know if everything from the PR was integrated since it had many things. |
Wrote on top of #8084 and #8061 (although it is independant of #8061).
About the bug:
When creating a secondary viewport's SDL_Window, it inherits some flags from the main window.
But not all flags should be inherited (not the fullscreen one in particular).
In the SDL2 impl, it used to only inherit the HighDPI flag, so I changed the SDL3 impl so that it only inherits the HighDPI flag.
I noticed the problem in my engine when I migrated from SDL2 to SDL3 recently. With my main window in borderless fullscreen, and the secondary ImGui viewports on my second monitor, it would crash when creating a new ImGui window (like when openning a combo or a color picker). The new secondary viewport would attempt to open fullscreen, conflicting with the main window. It ended up messing with the main window's VkSurface (VkSwapchain out of date and maximum extent of the surface to 0).