Skip to content

Commit

Permalink
Backends: Vulkan: ImGui_ImplVulkan_SwapBuffers() still proceeds incre…
Browse files Browse the repository at this point in the history
…asing counts on VK_SUBOPTIMAL_KHR. (#7825, #3881)

Amend 085cff2
  • Loading branch information
ocornut committed Jul 29, 2024
1 parent 5c9825c commit e212511
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions backends/imgui_impl_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1895,9 +1895,13 @@ static void ImGui_ImplVulkan_SwapBuffers(ImGuiViewport* viewport, void*)
if (err == VK_ERROR_OUT_OF_DATE_KHR || err == VK_SUBOPTIMAL_KHR)
{
vd->SwapChainNeedRebuild = true;
return;
if (err == VK_ERROR_OUT_OF_DATE_KHR)
return;
}
else
{
check_vk_result(err);
}
check_vk_result(err);

wd->FrameIndex = (wd->FrameIndex + 1) % wd->ImageCount; // This is for the next vkWaitForFences()
wd->SemaphoreIndex = (wd->SemaphoreIndex + 1) % wd->SemaphoreCount; // Now we can use the next set of semaphores
Expand Down
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,8 @@ Docking+Viewports Branch:
usage. (#7814) [@YGXXD]
- Backends: SDL3: Fixed a bug preventing ImGuiViewportFlags_NoFocusOnAppearing support from
working (Windows only).
- Backends: Vulkan: ImGui_ImplVulkan_SwapBuffers() used by secondary viewports still proceeds
increasing frame counters on VK_SUBOPTIMAL_KHR. (#7825, #3881) [@NostraMagister]


-----------------------------------------------------------------------
Expand Down

0 comments on commit e212511

Please sign in to comment.