From 07e5269ae92bba5f3c1ae14756e86ec752391688 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 20 Dec 2024 10:50:46 -0800 Subject: [PATCH] Handle errors in WaitAndAcquireGPUSwapchainTexture --- src/FNA3D_Driver_SDL.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/FNA3D_Driver_SDL.c b/src/FNA3D_Driver_SDL.c index bcf30c93..d2824fd5 100644 --- a/src/FNA3D_Driver_SDL.c +++ b/src/FNA3D_Driver_SDL.c @@ -1058,13 +1058,18 @@ static void SDLGPU_SwapBuffers( SDLGPU_INTERNAL_EndCopyPass(renderer); SDLGPU_INTERNAL_EndRenderPass(renderer); - if (SDL_WaitAndAcquireGPUSwapchainTexture( + if (!SDL_WaitAndAcquireGPUSwapchainTexture( renderer->renderCommandBuffer, overrideWindowHandle, &swapchainTexture, &width, &height - ) && swapchainTexture != NULL) { + )) { + FNA3D_LogError("Acquiring swapchain failed: %s", SDL_GetError()); + return; + } + + if (swapchainTexture != NULL) { blitInfo.source.texture = renderer->fauxBackbufferColorTexture->texture; blitInfo.source.mip_level = 0; blitInfo.source.layer_or_depth_plane = 0;