vulkan/wsi: Reset fences earlier in wsi_common_queue_present
authorJason Ekstrand <jason.ekstrand@collabora.com>
Fri, 20 May 2022 01:05:21 +0000 (20:05 -0500)
committerMarge Bot <emma+marge@anholt.net>
Fri, 10 Jun 2022 01:33:12 +0000 (01:33 +0000)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>

src/vulkan/wsi/wsi_common.c

index d3394f1..ac6a111 100644 (file)
@@ -984,6 +984,10 @@ wsi_common_queue_present(const struct wsi_device *wsi,
             goto fail_present;
       }
 
+      result = wsi->ResetFences(device, 1, &swapchain->fences[image_index]);
+      if (result != VK_SUCCESS)
+         goto fail_present;
+
       struct wsi_image *image =
          swapchain->get_wsi_image(swapchain, image_index);
 
@@ -1007,10 +1011,6 @@ wsi_common_queue_present(const struct wsi_device *wsi,
          submit_info.pWaitDstStageMask = stage_flags;
       }
 
-      result = wsi->ResetFences(device, 1, &swapchain->fences[image_index]);
-      if (result != VK_SUCCESS)
-         goto fail_present;
-
       VkFence fence = swapchain->fences[image_index];
       if (swapchain->use_buffer_blit) {
          if (swapchain->buffer_blit_queue == VK_NULL_HANDLE) {