The open source OpenXR runtime

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>

authored by

Simon Zeni
Rylie Pavlik
and committed by
Rylie Pavlik
241b4c6a cf9fe171

+9 -1
+9 -1
src/xrt/auxiliary/vk/vk_helpers.c
··· 1187 1187 #error "need port" 1188 1188 #endif 1189 1189 1190 - 1191 1190 if (handle_type == VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) { 1192 1191 /* 1193 1192 * Skip check in this case 1194 1193 * VUID-VkMemoryAllocateInfo-allocationSize-02383 1195 1194 * For AHardwareBuffer handles, the alloc size must be the size returned by 1196 1195 * vkGetAndroidHardwareBufferPropertiesANDROID for the Android hardware buffer 1196 + */ 1197 + } else if ((handle_type & (VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT | 1198 + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT | 1199 + VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT)) != 0) { 1200 + 1201 + /* 1202 + * For VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT and friends, 1203 + * the size must be queried by the implementation (See VkMemoryAllocateInfo manual page) 1204 + * so skip size check 1197 1205 */ 1198 1206 } else if (requirements.size == 0) { 1199 1207 /*