diff options
author | Jason Ekstrand <[email protected]> | 2017-11-16 10:44:41 -0800 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-12-04 10:04:19 -0800 |
commit | 516dfb34e10ae178b9754ce7fe22b7e88193440f (patch) | |
tree | 141cbefa2cf7a2741503324028567602ce46bd11 /src/intel | |
parent | 8ff49951c30bf47f29d8ed7c9ea7ab655417391b (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/intel')
-rw-r--r-- | src/intel/vulkan/anv_wsi.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c index 62368a10a06..6f5aaf6b704 100644 --- a/src/intel/vulkan/anv_wsi.c +++ b/src/intel/vulkan/anv_wsi.c @@ -234,24 +234,27 @@ VkResult anv_GetSwapchainImagesKHR( VkResult anv_AcquireNextImageKHR( VkDevice _device, - VkSwapchainKHR _swapchain, + VkSwapchainKHR swapchain, uint64_t timeout, VkSemaphore semaphore, - VkFence _fence, + VkFence fence, uint32_t* pImageIndex) { ANV_FROM_HANDLE(anv_device, device, _device); - ANV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain); - ANV_FROM_HANDLE(anv_fence, fence, _fence); + struct anv_physical_device *pdevice = &device->instance->physicalDevice; - VkResult result = swapchain->acquire_next_image(swapchain, timeout, - semaphore, pImageIndex); + VkResult result = wsi_common_acquire_next_image(&pdevice->wsi_device, + _device, + swapchain, + timeout, + semaphore, + pImageIndex); /* Thanks to implicit sync, the image is ready immediately. However, we * should wait for the current GPU state to finish. */ - if (fence) - anv_QueueSubmit(anv_queue_to_handle(&device->queue), 0, NULL, _fence); + if (fence != VK_NULL_HANDLE) + anv_QueueSubmit(anv_queue_to_handle(&device->queue), 0, NULL, fence); return result; } |