Support vkSetPrivateDataEXT/vkGetPrivateDataEXT
authorXuelian Bai <xuelian.bai@samsung.com>
Tue, 13 Jul 2021 02:38:23 +0000 (10:38 +0800)
committerXuelian Bai <xuelian.bai@samsung.com>
Tue, 21 Feb 2023 06:32:54 +0000 (14:32 +0800)
mesa assume that all object is created inside mesa, but for
VK_OBJECT_TYPE_SWAPCHAIN_KHR type, when we use vulkan_wsi_layer,
the object structure is different from mesa object, so don't use
mesa original object logic.

Change-Id: Iaea7f18e094b1bd1d2c7a4f4e7ecea0b81d9866a
Signed-Off-by: Xuelian Bai <xuelian.bai@samsung.com>
src/vulkan/runtime/vk_device.h
src/vulkan/runtime/vk_object.c

index afbb4af..b023abf 100644 (file)
@@ -242,7 +242,7 @@ struct vk_device {
     */
    enum vk_queue_submit_mode submit_mode;
 
-#ifdef ANDROID
+#if defined(ANDROID) || defined(HAVE_TIZEN_PLATFORM)
    mtx_t swapchain_private_mtx;
    struct hash_table *swapchain_private;
 #endif
index fb53ce6..ef7d538 100644 (file)
@@ -168,7 +168,7 @@ vk_private_data_slot_destroy(struct vk_device *device,
    vk_free2(&device->alloc, pAllocator, slot);
 }
 
-#ifdef ANDROID
+#if defined(ANDROID) || defined(HAVE_TIZEN_PLATFORM)
 static VkResult
 get_swapchain_private_data_locked(struct vk_device *device,
                                   uint64_t objectHandle,
@@ -216,7 +216,7 @@ vk_object_base_private_data(struct vk_device *device,
 {
    VK_FROM_HANDLE(vk_private_data_slot, slot, privateDataSlot);
 
-#ifdef ANDROID
+#if defined(ANDROID) || defined(HAVE_TIZEN_PLATFORM)
    /* 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