Skip to content

Commit

Permalink
Backends: Vulkan: vkQueuePresentKHR() returning VK_SUBOPTIMAL_KHR kee…
Browse files Browse the repository at this point in the history
…ps moving forward. (#7825)
  • Loading branch information
ocornut committed Jan 15, 2025
1 parent 015186a commit 507cdba
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions backends/imgui_impl_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1968,15 +1968,11 @@ static void ImGui_ImplVulkan_SwapBuffers(ImGuiViewport* viewport, void*)
info.pImageIndices = &present_index;
err = vkQueuePresentKHR(v->Queue, &info);
if (err == VK_ERROR_OUT_OF_DATE_KHR || err == VK_SUBOPTIMAL_KHR)
{
vd->SwapChainNeedRebuild = true;
if (err == VK_ERROR_OUT_OF_DATE_KHR)
return;
}
else
{
if (err == VK_ERROR_OUT_OF_DATE_KHR)
return;
if (err != VK_SUBOPTIMAL_KHR)
check_vk_result(err);
}
wd->SemaphoreIndex = (wd->SemaphoreIndex + 1) % wd->SemaphoreCount; // Now we can use the next set of semaphores
}

Expand Down

0 comments on commit 507cdba

Please sign in to comment.