Skip to content

Commit

Permalink
Handle errors in WaitAndAcquireGPUSwapchainTexture
Browse files Browse the repository at this point in the history
  • Loading branch information
thatcosmonaut authored and flibitijibibo committed Dec 21, 2024
1 parent 1089038 commit 077347c
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 @@ -1071,13 +1071,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 077347c

Please sign in to comment.