Skip to content

Commit

Permalink
Handle errors in WaitAndAcquireGPUSwapchainTexture
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcosmonaut committed Dec 20, 2024
1 parent a601c0c commit 07e5269
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/FNA3D_Driver_SDL.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 07e5269

Please sign in to comment.