aux/vk: skip image size check for d3d11 and d3d12 in vk_create_image_from_native

Co-authored-by: Rylie Pavlik <rylie.pavlik@collabora.com>
Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2332>
This commit is contained in:
Simon Zeni 2024-10-02 13:14:53 -04:00 committed by Rylie Pavlik
parent cf9fe1716e
commit 241b4c6a80

View file

@ -1187,7 +1187,6 @@ vk_create_image_from_native(struct vk_bundle *vk,
#error "need port"
#endif
if (handle_type == VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) {
/*
* Skip check in this case
@ -1195,6 +1194,15 @@ vk_create_image_from_native(struct vk_bundle *vk,
* For AHardwareBuffer handles, the alloc size must be the size returned by
* vkGetAndroidHardwareBufferPropertiesANDROID for the Android hardware buffer
*/
} else if ((handle_type & (VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT |
VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT |
VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT)) != 0) {
/*
* For VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT and friends,
* the size must be queried by the implementation (See VkMemoryAllocateInfo manual page)
* so skip size check
*/
} else if (requirements.size == 0) {
/*
* VUID-VkMemoryAllocateInfo-allocationSize-07899