From 363259a52ebc17d95482915ba89a6e1c48d2b1a9 Mon Sep 17 00:00:00 2001 From: Anish Bhobe Date: Fri, 5 Jul 2024 12:48:08 +0200 Subject: [PATCH] Fix sync bug. --- samples/01_triangle/triangle.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/01_triangle/triangle.cpp b/samples/01_triangle/triangle.cpp index 696e284..964323d 100644 --- a/samples/01_triangle/triangle.cpp +++ b/samples/01_triangle/triangle.cpp @@ -129,13 +129,13 @@ main(int, char **) viewport.width = Cast(swapchain.m_Extent.width); viewport.height = -Cast(swapchain.m_Extent.height); scissor.extent = swapchain.m_Extent; - break; + continue; // Image acquire has failed. We move to the next frame. default: ERROR("Waiting for swapchain image {} failed. Cause: {}", frameIndex, result) THEN_ABORT(result); } } - + // Reset fences here. In case swapchain was out of date, we leave the fences signalled. result = device.m_Device.resetFences(1, ¤tFrame->m_FrameAvailableFence); ERROR_IF(Failed(result), "Fence {} reset failed. Cause: {}", frameIndex, result) THEN_ABORT(result); @@ -227,7 +227,7 @@ main(int, char **) viewport.width = Cast(swapchain.m_Extent.width); viewport.height = -Cast(swapchain.m_Extent.height); scissor.extent = swapchain.m_Extent; - break; + break; // Present failed. We redo the frame. default: ERROR("Command queue present failed. Cause: {}", result) THEN_ABORT(result);