Fix sync bug.

This commit is contained in:
Anish Bhobe 2024-07-05 12:48:08 +02:00
parent c338c34337
commit 363259a52e
1 changed files with 3 additions and 3 deletions

View File

@ -129,13 +129,13 @@ main(int, char **)
viewport.width = Cast<f32>(swapchain.m_Extent.width); viewport.width = Cast<f32>(swapchain.m_Extent.width);
viewport.height = -Cast<f32>(swapchain.m_Extent.height); viewport.height = -Cast<f32>(swapchain.m_Extent.height);
scissor.extent = swapchain.m_Extent; scissor.extent = swapchain.m_Extent;
break; continue; // Image acquire has failed. We move to the next frame.
default: default:
ERROR("Waiting for swapchain image {} failed. Cause: {}", frameIndex, result) ERROR("Waiting for swapchain image {} failed. Cause: {}", frameIndex, result)
THEN_ABORT(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, &currentFrame->m_FrameAvailableFence); result = device.m_Device.resetFences(1, &currentFrame->m_FrameAvailableFence);
ERROR_IF(Failed(result), "Fence {} reset failed. Cause: {}", frameIndex, result) ERROR_IF(Failed(result), "Fence {} reset failed. Cause: {}", frameIndex, result)
THEN_ABORT(result); THEN_ABORT(result);
@ -227,7 +227,7 @@ main(int, char **)
viewport.width = Cast<f32>(swapchain.m_Extent.width); viewport.width = Cast<f32>(swapchain.m_Extent.width);
viewport.height = -Cast<f32>(swapchain.m_Extent.height); viewport.height = -Cast<f32>(swapchain.m_Extent.height);
scissor.extent = swapchain.m_Extent; scissor.extent = swapchain.m_Extent;
break; break; // Present failed. We redo the frame.
default: default:
ERROR("Command queue present failed. Cause: {}", result) ERROR("Command queue present failed. Cause: {}", result)
THEN_ABORT(result); THEN_ABORT(result);