From 6ae5666acf911d924e8deb6d5dba87c27a71f46c Mon Sep 17 00:00:00 2001
From: rabbit-ecl <[EMAIL REDACTED]>
Date: Mon, 7 Oct 2024 23:01:10 +0300
Subject: [PATCH] Check for VK_SUBOPTIMAL_KHR also in vkQueuePresentKHR
(#11113)
This is already handled for vkAcquireNextImageKHR.
---
src/gpu/vulkan/SDL_gpu_vulkan.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c
index d7a6145ff0265..984fd227aea30 100644
--- a/src/gpu/vulkan/SDL_gpu_vulkan.c
+++ b/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 {