diff --git a/src/vulkan/vulkan_presenter.cpp b/src/vulkan/vulkan_presenter.cpp index f4cfa522..3f2694d9 100644 --- a/src/vulkan/vulkan_presenter.cpp +++ b/src/vulkan/vulkan_presenter.cpp @@ -66,6 +66,15 @@ namespace dxvk::vk { return status; } + + VkResult Presenter::waitForFence(VkFence fence) { + // Ignore timeouts, we don't want to block the + // app indefinitely if something goes wrong + return m_vkd->vkWaitForFences( + m_vkd->device(), 1, &fence, VK_FALSE, + 1'000'000'000ull); + } + VkResult Presenter::presentImage(VkSemaphore wait) { VkPresentInfoKHR info; diff --git a/src/vulkan/vulkan_presenter.h b/src/vulkan/vulkan_presenter.h index 07138079..2e16a441 100644 --- a/src/vulkan/vulkan_presenter.h +++ b/src/vulkan/vulkan_presenter.h @@ -132,6 +132,17 @@ namespace dxvk::vk { VkFence fence, uint32_t& index); + /** + * \brief Waits for fence to get signaled + * + * Helper method that can be used in conjunction + * with the fence passed to \ref acquireNextImage. + * \param [in] fence Fence to wait on + * \returns Status of the operation + */ + VkResult waitForFence( + VkFence fence); + /** * \brief Presents current image *