Mesa (main): vulkan/wsi: Set memory ownership after signaling fences and semaphores

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jun 10 02:14:02 UTC 2022


Module: Mesa
Branch: main
Commit: 18bd05827d175b1a37bac2db560ae65ad7d71d3f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=18bd05827d175b1a37bac2db560ae65ad7d71d3f

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Mon Mar 15 12:19:54 2021 -0500

vulkan/wsi: Set memory ownership after signaling fences and semaphores

This isn't a functional change today because the set of drivers which
use set_ownership and those that use signal_fence/semaphore_for_memory
are mutually exclusive.  It's important for the next commit, though.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>

---

 src/vulkan/wsi/wsi_common.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index 1b1fbca8099..b90c8e420e2 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -891,12 +891,6 @@ wsi_common_acquire_next_image2(const struct wsi_device *wsi,
                                                    pImageIndex);
    if (result != VK_SUCCESS && result != VK_SUBOPTIMAL_KHR)
       return result;
-
-   if (wsi->set_memory_ownership) {
-      VkDeviceMemory mem = swapchain->get_wsi_image(swapchain, *pImageIndex)->memory;
-      wsi->set_memory_ownership(swapchain->device, mem, true);
-   }
-
    struct wsi_image *image =
       swapchain->get_wsi_image(swapchain, *pImageIndex);
 
@@ -916,6 +910,9 @@ wsi_common_acquire_next_image2(const struct wsi_device *wsi,
          return signal_result;
    }
 
+   if (wsi->set_memory_ownership)
+      wsi->set_memory_ownership(swapchain->device, image->memory, true);
+
    return result;
 }
 



More information about the mesa-commit mailing list