diff --git a/base/vulkanexamplebase.cpp b/base/vulkanexamplebase.cpp index 97dbcae3..e695a910 100644 --- a/base/vulkanexamplebase.cpp +++ b/base/vulkanexamplebase.cpp @@ -250,7 +250,7 @@ void VulkanExampleBase::renderFrame() timer -= 1.0f; } } - float fpsTimer = std::chrono::duration(tEnd - lastTimestamp).count(); + float fpsTimer = (float)(std::chrono::duration(tEnd - lastTimestamp).count()); if (fpsTimer > 1000.0f) { lastFPS = static_cast((float)frameCounter * (1000.0f / fpsTimer)); @@ -621,26 +621,26 @@ void VulkanExampleBase::drawUI(const VkCommandBuffer commandBuffer) void VulkanExampleBase::prepareFrame() { // Acquire the next image from the swap chain - VkResult err = swapChain.acquireNextImage(semaphores.presentComplete, ¤tBuffer); + VkResult result = swapChain.acquireNextImage(semaphores.presentComplete, ¤tBuffer); // Recreate the swapchain if it's no longer compatible with the surface (OUT_OF_DATE) or no longer optimal for presentation (SUBOPTIMAL) - if ((err == VK_ERROR_OUT_OF_DATE_KHR) || (err == VK_SUBOPTIMAL_KHR)) { + if ((result == VK_ERROR_OUT_OF_DATE_KHR) || (result == VK_SUBOPTIMAL_KHR)) { windowResize(); } else { - VK_CHECK_RESULT(err); + VK_CHECK_RESULT(result); } } void VulkanExampleBase::submitFrame() { - VkResult res = swapChain.queuePresent(queue, currentBuffer, semaphores.renderComplete); - if (!((res == VK_SUCCESS) || (res == VK_SUBOPTIMAL_KHR))) { - if (res == VK_ERROR_OUT_OF_DATE_KHR) { + VkResult result = swapChain.queuePresent(queue, currentBuffer, semaphores.renderComplete); + if (!((result == VK_SUCCESS) || (result == VK_SUBOPTIMAL_KHR))) { + if (result == VK_ERROR_OUT_OF_DATE_KHR) { // Swap chain is no longer compatible with the surface and needs to be recreated windowResize(); return; } else { - VK_CHECK_RESULT(res); + VK_CHECK_RESULT(result); } } VK_CHECK_RESULT(vkQueueWaitIdle(queue));