vulkan/wsi: Only wait on semaphores on the first swapchain
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 16 Nov 2017 17:07:58 +0000 (09:07 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 4 Dec 2017 18:04:19 +0000 (10:04 -0800)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
src/vulkan/wsi/wsi_common.c

index f149846e454066635855495ddf65f7d64d068f41..4f6648f988f3d2110ab71c8a2d142bd77d2299d3 100644 (file)
@@ -541,9 +541,14 @@ wsi_common_queue_present(const struct wsi_device *wsi,
       VkSubmitInfo submit_info = {
          .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
          .pNext = NULL,
-         .waitSemaphoreCount = pPresentInfo->waitSemaphoreCount,
-         .pWaitSemaphores = pPresentInfo->pWaitSemaphores,
       };
+      if (i == 0) {
+         /* We only need/want to wait on semaphores once.  After that, we're
+          * guaranteed ordering since it all happens on the same queue.
+          */
+         submit_info.waitSemaphoreCount = pPresentInfo->waitSemaphoreCount,
+         submit_info.pWaitSemaphores = pPresentInfo->pWaitSemaphores,
+      }
       result = wsi->QueueSubmit(queue, 1, &submit_info, swapchain->fences[0]);
       if (result != VK_SUCCESS)
          goto fail_present;