Browse Source

Vulkan: Fix not incrementing semaphore index. (#2472, #2071)

omar 6 years ago
parent
commit
c43dab2414
2 changed files with 2 additions and 0 deletions
  1. 1 0
      examples/example_glfw_vulkan/main.cpp
  2. 1 0
      examples/example_sdl_vulkan/main.cpp

+ 1 - 0
examples/example_glfw_vulkan/main.cpp

@@ -320,6 +320,7 @@ static void FramePresent(ImGui_ImplVulkanH_Window* wd)
     info.pImageIndices = &wd->FrameIndex;
     VkResult err = vkQueuePresentKHR(g_Queue, &info);
     check_vk_result(err);
+    wd->SemaphoreIndex = (wd->SemaphoreIndex + 1) % wd->ImageCount; // Now we can use the next set of semaphores
 }
 
 static void glfw_error_callback(int error, const char* description)

+ 1 - 0
examples/example_sdl_vulkan/main.cpp

@@ -312,6 +312,7 @@ static void FramePresent(ImGui_ImplVulkanH_Window* wd)
     info.pImageIndices = &wd->FrameIndex;
     VkResult err = vkQueuePresentKHR(g_Queue, &info);
     check_vk_result(err);
+    wd->SemaphoreIndex = (wd->SemaphoreIndex + 1) % wd->ImageCount; // Now we can use the next set of semaphores
 }
 
 int main(int, char**)