Skip to content

Commit c5edf4b

Browse files
thatcosmonautslouken
authored andcommitted
GPU: Bail out of aquiring Vulkan swapchain if window is hidden
1 parent 6d580d7 commit c5edf4b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/gpu/vulkan/SDL_gpu_vulkan.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9934,6 +9934,11 @@ static bool VULKAN_INTERNAL_AcquireSwapchainTexture(
99349934
SET_STRING_ERROR_AND_RETURN("Cannot acquire a swapchain texture from an unclaimed window!", false);
99359935
}
99369936

9937+
if (window->flags & SDL_WINDOW_HIDDEN) {
9938+
// Edge case, texture is filled in with NULL but not an error
9939+
return true;
9940+
}
9941+
99379942
// If window data marked as needing swapchain recreate, try to recreate
99389943
if (windowData->needsSwapchainRecreate) {
99399944
Uint32 recreateSwapchainResult = VULKAN_INTERNAL_RecreateSwapchain(renderer, windowData);

0 commit comments

Comments
 (0)