From e0f283cfcbbc6b04a6c045ddf61134f4c0e10e1d Mon Sep 17 00:00:00 2001 From: omar Date: Fri, 2 Mar 2018 20:08:15 +0100 Subject: [PATCH] Examples: Vulkan: Fix 7b968b098eeb1e162504d42183ca6618568e859c --- examples/sdl_vulkan_example/main.cpp | 3 +-- examples/vulkan_example/main.cpp | 5 +++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/sdl_vulkan_example/main.cpp b/examples/sdl_vulkan_example/main.cpp index e8e89ac2..9cab5c38 100644 --- a/examples/sdl_vulkan_example/main.cpp +++ b/examples/sdl_vulkan_example/main.cpp @@ -528,8 +528,6 @@ static void frame_present() info.pImageIndices = &fd->BackbufferIndex; err = vkQueuePresentKHR(g_Queue, &info); check_vk_result(err); - - g_FrameIndex = (g_FrameIndex + 1) % IMGUI_VK_QUEUED_FRAMES; } int main(int, char**) @@ -699,6 +697,7 @@ int main(int, char**) frame_present(); #endif swap_chain_has_at_least_one_image = true; + g_FrameIndex = (g_FrameIndex + 1) % IMGUI_VK_QUEUED_FRAMES; } // Cleanup diff --git a/examples/vulkan_example/main.cpp b/examples/vulkan_example/main.cpp index 8ca526b9..a030a2b0 100644 --- a/examples/vulkan_example/main.cpp +++ b/examples/vulkan_example/main.cpp @@ -533,8 +533,6 @@ static void frame_present() info.pImageIndices = &fd->BackbufferIndex; err = vkQueuePresentKHR(g_Queue, &info); check_vk_result(err); - - g_FrameIndex = (g_FrameIndex + 1) % IMGUI_VK_QUEUED_FRAMES; } static void glfw_error_callback(int error, const char* description) @@ -699,7 +697,10 @@ int main(int, char**) #else frame_present(); #endif + swap_chain_has_at_least_one_image = true; + g_FrameIndex = (g_FrameIndex + 1) % IMGUI_VK_QUEUED_FRAMES; + // FIXME-PLATFORM ImGui::UpdatePlatformWindows(); ImGui::RenderPlatformWindows(); }