summaryrefslogtreecommitdiffstats
path: root/src/vulkan
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-11-16 10:44:41 -0800
committerJason Ekstrand <[email protected]>2017-12-04 10:04:19 -0800
commit516dfb34e10ae178b9754ce7fe22b7e88193440f (patch)
tree141cbefa2cf7a2741503324028567602ce46bd11 /src/vulkan
parent8ff49951c30bf47f29d8ed7c9ea7ab655417391b (diff)
vulkan/wsi: Add a helper for AcquireNextImage
Unfortunately, due to the fact that AcquireNextImage does not take a queue, the ANV trick for triggering the fence won't work in general. We leave dealing with the fence up to the caller for now. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
Diffstat (limited to 'src/vulkan')
-rw-r--r--src/vulkan/wsi/wsi_common.c14
-rw-r--r--src/vulkan/wsi/wsi_common.h8
2 files changed, 22 insertions, 0 deletions
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index 69cb71dfdbc..50680a6fd75 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -540,6 +540,20 @@ wsi_common_get_images(VkSwapchainKHR _swapchain,
}
VkResult
+wsi_common_acquire_next_image(const struct wsi_device *wsi,
+ VkDevice device,
+ VkSwapchainKHR _swapchain,
+ uint64_t timeout,
+ VkSemaphore semaphore,
+ uint32_t *pImageIndex)
+{
+ WSI_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain);
+
+ return swapchain->acquire_next_image(swapchain, timeout,
+ semaphore, pImageIndex);
+}
+
+VkResult
wsi_common_queue_present(const struct wsi_device *wsi,
VkDevice device,
VkQueue queue,
diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h
index 6ed10b85921..aab6ca1c271 100644
--- a/src/vulkan/wsi/wsi_common.h
+++ b/src/vulkan/wsi/wsi_common.h
@@ -221,6 +221,14 @@ wsi_common_get_images(VkSwapchainKHR _swapchain,
VkImage *pSwapchainImages);
VkResult
+wsi_common_acquire_next_image(const struct wsi_device *wsi,
+ VkDevice device,
+ VkSwapchainKHR swapchain,
+ uint64_t timeout,
+ VkSemaphore semaphore,
+ uint32_t *pImageIndex);
+
+VkResult
wsi_common_create_swapchain(struct wsi_device *wsi,
VkDevice device,
int fd,