[vulkan] Add helper method to wait for presenter fence

This commit is contained in:
Philip Rebohle 2019-02-21 16:25:10 +01:00
parent 2231caaa9e
commit a6d1fe07f2
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
2 changed files with 20 additions and 0 deletions

View File

@ -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;

View File

@ -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
*