@@ -250,7 +250,7 @@ void VulkanExampleBase::renderFrame()
250
250
timer -= 1 .0f ;
251
251
}
252
252
}
253
- float fpsTimer = std::chrono::duration<double , std::milli>(tEnd - lastTimestamp).count ();
253
+ float fpsTimer = ( float )( std::chrono::duration<double , std::milli>(tEnd - lastTimestamp).count () );
254
254
if (fpsTimer > 1000 .0f )
255
255
{
256
256
lastFPS = static_cast <uint32_t >((float )frameCounter * (1000 .0f / fpsTimer));
@@ -621,26 +621,26 @@ void VulkanExampleBase::drawUI(const VkCommandBuffer commandBuffer)
621
621
void VulkanExampleBase::prepareFrame ()
622
622
{
623
623
// Acquire the next image from the swap chain
624
- VkResult err = swapChain.acquireNextImage (semaphores.presentComplete , ¤tBuffer);
624
+ VkResult result = swapChain.acquireNextImage (semaphores.presentComplete , ¤tBuffer);
625
625
// Recreate the swapchain if it's no longer compatible with the surface (OUT_OF_DATE) or no longer optimal for presentation (SUBOPTIMAL)
626
- if ((err == VK_ERROR_OUT_OF_DATE_KHR) || (err == VK_SUBOPTIMAL_KHR)) {
626
+ if ((result == VK_ERROR_OUT_OF_DATE_KHR) || (result == VK_SUBOPTIMAL_KHR)) {
627
627
windowResize ();
628
628
}
629
629
else {
630
- VK_CHECK_RESULT (err );
630
+ VK_CHECK_RESULT (result );
631
631
}
632
632
}
633
633
634
634
void VulkanExampleBase::submitFrame ()
635
635
{
636
- VkResult res = swapChain.queuePresent (queue, currentBuffer, semaphores.renderComplete );
637
- if (!((res == VK_SUCCESS) || (res == VK_SUBOPTIMAL_KHR))) {
638
- if (res == VK_ERROR_OUT_OF_DATE_KHR) {
636
+ VkResult result = swapChain.queuePresent (queue, currentBuffer, semaphores.renderComplete );
637
+ if (!((result == VK_SUCCESS) || (result == VK_SUBOPTIMAL_KHR))) {
638
+ if (result == VK_ERROR_OUT_OF_DATE_KHR) {
639
639
// Swap chain is no longer compatible with the surface and needs to be recreated
640
640
windowResize ();
641
641
return ;
642
642
} else {
643
- VK_CHECK_RESULT (res );
643
+ VK_CHECK_RESULT (result );
644
644
}
645
645
}
646
646
VK_CHECK_RESULT (vkQueueWaitIdle (queue));
0 commit comments