From 516dfb34e10ae178b9754ce7fe22b7e88193440f Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 16 Nov 2017 10:44:41 -0800 Subject: 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 Reviewed-by: Chad Versace --- src/vulkan/wsi/wsi_common.c | 14 ++++++++++++++ src/vulkan/wsi/wsi_common.h | 8 ++++++++ 2 files changed, 22 insertions(+) (limited to 'src/vulkan') 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 @@ -539,6 +539,20 @@ wsi_common_get_images(VkSwapchainKHR _swapchain, return vk_outarray_status(&images); } +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, 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 @@ -220,6 +220,14 @@ wsi_common_get_images(VkSwapchainKHR _swapchain, uint32_t *pSwapchainImageCount, 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, -- cgit v1.2.3