diff options
author | Jason Ekstrand <[email protected]> | 2018-09-20 05:30:03 -0500 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2018-09-21 07:02:35 -0500 |
commit | ab80889e92e2a3c2884e5da925424f9f6a88979b (patch) | |
tree | 54227ff0576a7f798ba2cba36a6294022830a5de /src/vulkan/wsi | |
parent | 24bacaddefafd806c7456f2ab6912ae5da4c0d9e (diff) |
anv,radv: Implement vkAcquireNextImage2
This was added as part of 1.1 but it's very hard to track exactly what
extension added it. In any case, we should implement it.
Cc: [email protected]
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/vulkan/wsi')
-rw-r--r-- | src/vulkan/wsi/wsi_common.c | 15 | ||||
-rw-r--r-- | src/vulkan/wsi/wsi_common.h | 10 | ||||
-rw-r--r-- | src/vulkan/wsi/wsi_common_display.c | 4 | ||||
-rw-r--r-- | src/vulkan/wsi/wsi_common_private.h | 2 | ||||
-rw-r--r-- | src/vulkan/wsi/wsi_common_wayland.c | 3 | ||||
-rw-r--r-- | src/vulkan/wsi/wsi_common_x11.c | 4 |
6 files changed, 16 insertions, 22 deletions
diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c index f2d90a6bba2..3416fef3076 100644 --- a/src/vulkan/wsi/wsi_common.c +++ b/src/vulkan/wsi/wsi_common.c @@ -856,17 +856,14 @@ 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_common_acquire_next_image2(const struct wsi_device *wsi, + VkDevice device, + const VkAcquireNextImageInfoKHR *pAcquireInfo, + uint32_t *pImageIndex) { - WSI_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain); + WSI_FROM_HANDLE(wsi_swapchain, swapchain, pAcquireInfo->swapchain); - return swapchain->acquire_next_image(swapchain, timeout, - semaphore, pImageIndex); + return swapchain->acquire_next_image(swapchain, pAcquireInfo, pImageIndex); } VkResult diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h index 33e4f849ac9..14f65097bb3 100644 --- a/src/vulkan/wsi/wsi_common.h +++ b/src/vulkan/wsi/wsi_common.h @@ -209,12 +209,10 @@ 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); +wsi_common_acquire_next_image2(const struct wsi_device *wsi, + VkDevice device, + const VkAcquireNextImageInfoKHR *pAcquireInfo, + uint32_t *pImageIndex); VkResult wsi_common_create_swapchain(struct wsi_device *wsi, diff --git a/src/vulkan/wsi/wsi_common_display.c b/src/vulkan/wsi/wsi_common_display.c index 1e90bba460c..e99b0465ec9 100644 --- a/src/vulkan/wsi/wsi_common_display.c +++ b/src/vulkan/wsi/wsi_common_display.c @@ -1197,8 +1197,7 @@ wsi_display_wait_for_event(struct wsi_display *wsi, static VkResult wsi_display_acquire_next_image(struct wsi_swapchain *drv_chain, - uint64_t timeout, - VkSemaphore semaphore, + const VkAcquireNextImageInfoKHR *info, uint32_t *image_index) { struct wsi_display_swapchain *chain = @@ -1211,6 +1210,7 @@ wsi_display_acquire_next_image(struct wsi_swapchain *drv_chain, if (chain->status != VK_SUCCESS) return chain->status; + uint64_t timeout = info->timeout; if (timeout != 0 && timeout != UINT64_MAX) timeout = wsi_rel_to_abs_time(timeout); diff --git a/src/vulkan/wsi/wsi_common_private.h b/src/vulkan/wsi/wsi_common_private.h index 9f2aacd6560..ee7ae75b8f7 100644 --- a/src/vulkan/wsi/wsi_common_private.h +++ b/src/vulkan/wsi/wsi_common_private.h @@ -62,7 +62,7 @@ struct wsi_swapchain { struct wsi_image *(*get_wsi_image)(struct wsi_swapchain *swapchain, uint32_t image_index); VkResult (*acquire_next_image)(struct wsi_swapchain *swap_chain, - uint64_t timeout, VkSemaphore semaphore, + const VkAcquireNextImageInfoKHR *info, uint32_t *image_index); VkResult (*queue_present)(struct wsi_swapchain *swap_chain, uint32_t image_index, diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c index 4a6a4a29b93..6b34e21bd98 100644 --- a/src/vulkan/wsi/wsi_common_wayland.c +++ b/src/vulkan/wsi/wsi_common_wayland.c @@ -658,8 +658,7 @@ wsi_wl_swapchain_get_wsi_image(struct wsi_swapchain *wsi_chain, static VkResult wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain, - uint64_t timeout, - VkSemaphore semaphore, + const VkAcquireNextImageInfoKHR *info, uint32_t *image_index) { struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain; diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c index d4c1790575f..5f99b2ee473 100644 --- a/src/vulkan/wsi/wsi_common_x11.c +++ b/src/vulkan/wsi/wsi_common_x11.c @@ -948,11 +948,11 @@ x11_present_to_x11(struct x11_swapchain *chain, uint32_t image_index, static VkResult x11_acquire_next_image(struct wsi_swapchain *anv_chain, - uint64_t timeout, - VkSemaphore semaphore, + const VkAcquireNextImageInfoKHR *info, uint32_t *image_index) { struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain; + uint64_t timeout = info->timeout; if (chain->threaded) { return x11_acquire_next_image_from_queue(chain, image_index, timeout); |