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: 3c87618d35 ("vulkan: Handle vkGet/SetPrivateDataEXT on Android swapchains")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24752>
(cherry picked from commit 710d478066)
This commit is contained in:
antonino 2023-08-17 15:06:18 +02:00 committed by Eric Engestrom
parent 415f2a6a9c
commit ec4c6f87a4
3 changed files with 2 additions and 8 deletions

View file

@ -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"
},

View file

@ -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,

View file

@ -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);