SDL: GPU: Bail out of aquiring Vulkan swapchain if window is hidden (f759e)

From f759e7ac59e8895238b41e642fa1c37d65ee1920 Mon Sep 17 00:00:00 2001
From: cosmonaut <[EMAIL REDACTED]>
Date: Thu, 31 Jul 2025 14:12:45 -0700
Subject: [PATCH] GPU: Bail out of aquiring Vulkan swapchain if window is
 hidden

(cherry picked from commit c5edf4bd5b249848c771bd6c08bd3da945c70c2d)
---
 src/gpu/vulkan/SDL_gpu_vulkan.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gpu/vulkan/SDL_gpu_vulkan.c b/src/gpu/vulkan/SDL_gpu_vulkan.c
index 93bc1158d1dc8..7eabee8d14030 100644
--- a/src/gpu/vulkan/SDL_gpu_vulkan.c
+++ b/src/gpu/vulkan/SDL_gpu_vulkan.c
@@ -9934,6 +9934,11 @@ static bool VULKAN_INTERNAL_AcquireSwapchainTexture(
         SET_STRING_ERROR_AND_RETURN("Cannot acquire a swapchain texture from an unclaimed window!", false);
     }
 
+    if (window->flags & SDL_WINDOW_HIDDEN) {
+        // Edge case, texture is filled in with NULL but not an error
+        return true;
+    }
+
     // If window data marked as needing swapchain recreate, try to recreate
     if (windowData->needsSwapchainRecreate) {
         Uint32 recreateSwapchainResult = VULKAN_INTERNAL_RecreateSwapchain(renderer, windowData);