Mesa (master): anv/wsi: Set the fence to signaled in AcquireNextImageKHR

Jason Ekstrand jekstrand at kemper.freedesktop.org
Thu Nov 10 02:18:14 UTC 2016


Module: Mesa
Branch: master
Commit: 73701be667ae408772bf20cb504b70d1775d4a4b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=73701be667ae408772bf20cb504b70d1775d4a4b

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Wed Nov  2 14:45:37 2016 -0700

anv/wsi: Set the fence to signaled in AcquireNextImageKHR

Signed-off-by: Jason Ekstrand <jason at jlekstrand.net>
Reviewed-by: Chad Versace <chadversary at chromium.org>
Cc: "13.0" <mesa-stable at lists.freedesktop.org>

---

 src/intel/vulkan/anv_wsi.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index 064581d..61d5db0 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -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(




More information about the mesa-commit mailing list