anv/wsi: Set the fence to signaled in AcquireNextImageKHR
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 2 Nov 2016 21:45:37 +0000 (14:45 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 10 Nov 2016 02:17:21 +0000 (18:17 -0800)
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Chad Versace <chadversary@chromium.org>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
src/intel/vulkan/anv_wsi.c

index 064581d5d3883e4eb0fcaef1fea0104f382a4e3a..61d5db079798007b05ea7c32252feb3c1452cee9 100644 (file)
@@ -323,13 +323,20 @@ VkResult anv_AcquireNextImageKHR(
     VkSwapchainKHR                               _swapchain,
     uint64_t                                     timeout,
     VkSemaphore                                  semaphore,
-    VkFence                                      fence,
+    VkFence                                      _fence,
     uint32_t*                                    pImageIndex)
 {
    ANV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain);
+   ANV_FROM_HANDLE(anv_fence, fence, _fence);
 
-   return swapchain->acquire_next_image(swapchain, timeout, semaphore,
-                                        pImageIndex);
+   VkResult result = swapchain->acquire_next_image(swapchain, timeout,
+                                                   semaphore, pImageIndex);
+
+   /* Thanks to implicit sync, the image is ready immediately. */
+   if (fence)
+      fence->ready = true;
+
+   return result;
 }
 
 VkResult anv_QueuePresentKHR(