summaryrefslogtreecommitdiffstats
path: root/src/amd
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/amd
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/amd')
-rw-r--r--src/amd/vulkan/radv_wsi.c35
1 files changed, 25 insertions, 10 deletions
diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c
index 20484177135..6479bea070b 100644
--- a/src/amd/vulkan/radv_wsi.c
+++ b/src/amd/vulkan/radv_wsi.c
@@ -206,23 +206,38 @@ VkResult radv_GetSwapchainImagesKHR(
}
VkResult radv_AcquireNextImageKHR(
- VkDevice _device,
+ VkDevice device,
VkSwapchainKHR swapchain,
uint64_t timeout,
VkSemaphore semaphore,
- VkFence _fence,
+ 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 radv_AcquireNextImage2KHR(device, &acquire_info, pImageIndex);
+}
+
+VkResult radv_AcquireNextImage2KHR(
+ VkDevice _device,
+ const VkAcquireNextImageInfoKHR* pAcquireInfo,
uint32_t* pImageIndex)
{
RADV_FROM_HANDLE(radv_device, device, _device);
struct radv_physical_device *pdevice = device->physical_device;
- RADV_FROM_HANDLE(radv_fence, fence, _fence);
-
- VkResult result = wsi_common_acquire_next_image(&pdevice->wsi_device,
- _device,
- swapchain,
- timeout,
- semaphore,
- pImageIndex);
+ RADV_FROM_HANDLE(radv_fence, fence, pAcquireInfo->fence);
+
+ VkResult result = wsi_common_acquire_next_image2(&pdevice->wsi_device,
+ _device,
+ pAcquireInfo,
+ pImageIndex);
if (fence && (result == VK_SUCCESS || result == VK_SUBOPTIMAL_KHR)) {
fence->submitted = true;