From c5edf4bd5b249848c771bd6c08bd3da945c70c2d 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
---
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 182862fe1f113..754d5b5ae4a64 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);