summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_wsi.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2018-09-20 05:30:03 -0500
committerJason Ekstrand <[email protected]>2018-09-21 07:02:35 -0500
commitab80889e92e2a3c2884e5da925424f9f6a88979b (patch)
tree54227ff0576a7f798ba2cba36a6294022830a5de /src/intel/vulkan/anv_wsi.c
parent24bacaddefafd806c7456f2ab6912ae5da4c0d9e (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/intel/vulkan/anv_wsi.c')
-rw-r--r--src/intel/vulkan/anv_wsi.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index 1403601e9c0..5ed1d711689 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -216,28 +216,45 @@ VkResult anv_GetSwapchainImagesKHR(
}
VkResult anv_AcquireNextImageKHR(
- VkDevice _device,
+ VkDevice device,
VkSwapchainKHR swapchain,
uint64_t timeout,
VkSemaphore semaphore,
VkFence fence,
uint32_t* pImageIndex)
{
+ VkAcquireNextImageInfoKHR acquire_info = {
+ .sType = VK_STRUCTURE_TYPE_ACQUIRE_NEXT_IMAGE_INFO_KHR,
+ .swapchain = swapchain,
+ .timeout = timeout,
+ .semaphore = semaphore,
+ .fence = fence,
+ .deviceMask = 0,
+ };
+
+ return anv_AcquireNextImage2KHR(device, &acquire_info, pImageIndex);
+}
+
+VkResult anv_AcquireNextImage2KHR(
+ VkDevice _device,
+ const VkAcquireNextImageInfoKHR* pAcquireInfo,
+ uint32_t* pImageIndex)
+{
ANV_FROM_HANDLE(anv_device, device, _device);
struct anv_physical_device *pdevice = &device->instance->physicalDevice;
- VkResult result = wsi_common_acquire_next_image(&pdevice->wsi_device,
- _device,
- swapchain,
- timeout,
- semaphore,
- pImageIndex);
+ VkResult result = wsi_common_acquire_next_image2(&pdevice->wsi_device,
+ _device,
+ pAcquireInfo,
+ pImageIndex);
/* Thanks to implicit sync, the image is ready immediately. However, we
* should wait for the current GPU state to finish.
*/
- if (fence != VK_NULL_HANDLE)
- anv_QueueSubmit(anv_queue_to_handle(&device->queue), 0, NULL, fence);
+ if (pAcquireInfo->fence != VK_NULL_HANDLE) {
+ anv_QueueSubmit(anv_queue_to_handle(&device->queue), 0, NULL,
+ pAcquireInfo->fence);
+ }
return result;
}