Browse Source

Check for VK_SUBOPTIMAL_KHR also in vkQueuePresentKHR (#11113)

This is already handled for vkAcquireNextImageKHR.
rabbit-ecl 6 months ago
parent
commit
6ae5666acf
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/gpu/vulkan/SDL_gpu_vulkan.c

+ 2 - 2
src/gpu/vulkan/SDL_gpu_vulkan.c

@@ -10235,12 +10235,12 @@ static bool VULKAN_Submit(
         presentData->windowData->frameCounter =
             (presentData->windowData->frameCounter + 1) % MAX_FRAMES_IN_FLIGHT;
 
-        if (presentResult == VK_SUCCESS || presentResult == VK_ERROR_OUT_OF_DATE_KHR) {
+        if (presentResult == VK_SUCCESS || presentResult == VK_SUBOPTIMAL_KHR || presentResult == VK_ERROR_OUT_OF_DATE_KHR) {
             // If presenting, the swapchain is using the in-flight fence
             presentData->windowData->inFlightFences[presentData->windowData->frameCounter] = (SDL_GPUFence*)vulkanCommandBuffer->inFlightFence;
             (void)SDL_AtomicIncRef(&vulkanCommandBuffer->inFlightFence->referenceCount);
 
-            if (presentResult == VK_ERROR_OUT_OF_DATE_KHR) {
+            if (presentResult == VK_SUBOPTIMAL_KHR || presentResult == VK_ERROR_OUT_OF_DATE_KHR) {
                 presentData->windowData->needsSwapchainRecreate = true;
             }
         } else {