-
-
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
Vulkan: Fixing secondary viewport resize problems on linux #7513
Conversation
This happens because when vkAcquireNextImageKHR returns VK_ERROR_OUT_OF_DATE_KHR, the following err check cause the example to abort. If the swap chain turns out to be out of date when attempting to acquire an image, then it is no longer possible to present to it. Therefore we should immediately recreate the swap chain and try again in the next drawFrame call. (source) There is probably a better way to skip the current frame other than adding a new bool in wd & returning 2 functions, but I'm not familiar enough with imgui's backend to think about one atm. But this pr makes resizing secondary viewports work as intended on linux (or whatever else my system & #3758 have in common that make this issue happen in the first place) I know this is an annoying issue to reproduce on your side so I just went ahead and attempted to fix it myself, feel free to edit it to your likings. |
else | ||
return; | ||
} | ||
else | ||
check_vk_result(err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of returning here and not incrementing both indexes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also confirm that both paths calling ImGui_ImplVulkanH_CreateOrResizeWindow()
are needed?
Sorry for the amount of details requested, but since this is rather subtle and brittle and hard to reproduce, any extra details are useful for our records.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
none of this is needed that's just how I handle it in my own backend.
wd->CanPresent = true; | ||
return; | ||
} | ||
|
||
VkResult err; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also clarify how this is needed?
Our main.cpp example do a similar thing via setting g_SwapChainRebuild = true
but it is primarily because the swap chain recreation is deferred to later.
Can you confirm what happens if you attempt the vkQueuePresentKHR()
? for my records. Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and yeah answers to this are in #3390
This should now be fixed, see other PR: Both PR were AFAIK near identical in results, given the complexity of this, I would appreciate if everyone affected could confirm that it fixes the situation for them. Thanks everyone! |
this fixes #7508
and maybe #3758 as well