diff --git a/src/hooks.cpp b/src/hooks.cpp index 826c817..7eff7a9 100644 --- a/src/hooks.cpp +++ b/src/hooks.cpp @@ -210,6 +210,20 @@ namespace { auto& deviceInfo = devices.at(swapchainToDeviceTable.at(*pPresentInfo->pSwapchains)); auto& swapchain = swapchains.at(*pPresentInfo->pSwapchains); + // patch vsync NOLINTBEGIN + const VkSwapchainPresentModeInfoEXT* presentModeInfo = + reinterpret_cast(pPresentInfo->pNext); + while (presentModeInfo) { + if (presentModeInfo->sType == VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_MODE_INFO_EXT) { + for (size_t i = 0; i < presentModeInfo->swapchainCount; i++) + const_cast(presentModeInfo->pPresentModes)[i] = + VK_PRESENT_MODE_FIFO_KHR; + } + presentModeInfo = + reinterpret_cast(presentModeInfo->pNext); + } // NOLINTEND + + // present the next frame Log::debug("hooks2", "Presenting swapchain: {:x} on queue: {:x}", reinterpret_cast(*pPresentInfo->pSwapchains), reinterpret_cast(queue));