Skip to content

Commit

Permalink
Viewports, Backends: Vulkan: Rebuild swapchain on VK_SUBOPTIMAL_KHR. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Mar 18, 2021
1 parent b17bfdd commit 085cff2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion backends/imgui_impl_vulkan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1619,7 +1619,7 @@ static void ImGui_ImplVulkan_SwapBuffers(ImGuiViewport* viewport, void*)
info.pSwapchains = &wd->Swapchain;
info.pImageIndices = &present_index;
err = vkQueuePresentKHR(v->Queue, &info);
if (err == VK_ERROR_OUT_OF_DATE_KHR)
if (err == VK_ERROR_OUT_OF_DATE_KHR || err == VK_SUBOPTIMAL_KHR)
ImGui_ImplVulkanH_CreateOrResizeWindow(v->Instance, v->PhysicalDevice, v->Device, &data->Window, v->QueueFamily, v->Allocator, (int)viewport->Size.x, (int)viewport->Size.y, v->MinImageCount);
else
check_vk_result(err);
Expand Down

0 comments on commit 085cff2

Please sign in to comment.