Module: Mesa
Branch: staging/23.1
Commit: ec4c6f87a45728d8f2e70dac58dfc137d4d0d703
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=ec4c6f87a45728d8f2e70dac58dfc137d4d0d703

Author: antonino <[email protected]>
Date:   Thu Aug 17 15:06:18 2023 +0200

vulkan: Extend vkGet/SetPrivateDataEXT handling to all platforms

Non-android platforms use mesa WSI, however some WSI object still don't
extend `vk_object_base` so they still need special handling.

Fixes: 3c87618d357 ("vulkan: Handle vkGet/SetPrivateDataEXT on Android 
swapchains")
Reviewed-by: Lionel Landwerlin <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24752>
(cherry picked from commit 710d4780663aac597d88364a76e828bcbf1c7e8e)

---

 .pick_status.json              | 2 +-
 src/vulkan/runtime/vk_device.h | 2 --
 src/vulkan/runtime/vk_object.c | 6 +-----
 3 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 715e36f0023..8875a6933cf 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -589,7 +589,7 @@
         "description": "vulkan: Extend vkGet/SetPrivateDataEXT handling to all 
platforms",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "3c87618d357a4f75a4f47b2638c8f89939fd6c61"
     },
diff --git a/src/vulkan/runtime/vk_device.h b/src/vulkan/runtime/vk_device.h
index cefcc48ea72..f22a700fb19 100644
--- a/src/vulkan/runtime/vk_device.h
+++ b/src/vulkan/runtime/vk_device.h
@@ -242,10 +242,8 @@ struct vk_device {
 
    struct vk_memory_trace_data memory_trace_data;
 
-#ifdef ANDROID
    mtx_t swapchain_private_mtx;
    struct hash_table *swapchain_private;
-#endif
 };
 
 VK_DEFINE_HANDLE_CASTS(vk_device, base, VkDevice,
diff --git a/src/vulkan/runtime/vk_object.c b/src/vulkan/runtime/vk_object.c
index fb53ce6cb00..9180d2ce132 100644
--- a/src/vulkan/runtime/vk_object.c
+++ b/src/vulkan/runtime/vk_object.c
@@ -168,7 +168,6 @@ vk_private_data_slot_destroy(struct vk_device *device,
    vk_free2(&device->alloc, pAllocator, slot);
 }
 
-#ifdef ANDROID
 static VkResult
 get_swapchain_private_data_locked(struct vk_device *device,
                                   uint64_t objectHandle,
@@ -177,7 +176,7 @@ get_swapchain_private_data_locked(struct vk_device *device,
 {
    if (unlikely(device->swapchain_private == NULL)) {
       /* Even though VkSwapchain is a non-dispatchable object, we know a
-       * priori that Android swapchains are actually pointers so we can use
+       * priori that it is actually a pointer so we can use
        * the pointer hash table for them.
        */
       device->swapchain_private = _mesa_pointer_hash_table_create(NULL);
@@ -205,7 +204,6 @@ get_swapchain_private_data_locked(struct vk_device *device,
 
    return VK_SUCCESS;
 }
-#endif /* ANDROID */
 
 static VkResult
 vk_object_base_private_data(struct vk_device *device,
@@ -216,7 +214,6 @@ vk_object_base_private_data(struct vk_device *device,
 {
    VK_FROM_HANDLE(vk_private_data_slot, slot, privateDataSlot);
 
-#ifdef ANDROID
    /* There is an annoying spec corner here on Android.  Because WSI is
     * implemented in the Vulkan loader which doesn't know about the
     * VK_EXT_private_data extension, we have to handle VkSwapchainKHR in the
@@ -232,7 +229,6 @@ vk_object_base_private_data(struct vk_device *device,
       mtx_unlock(&device->swapchain_private_mtx);
       return result;
    }
-#endif /* ANDROID */
 
    struct vk_object_base *obj =
       vk_object_base_from_u64_handle(objectHandle, objectType);

Reply via email to