The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

aux/vk: skip image size check for android 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
22313d4c c6c7a004

+10 -1
+10 -1
src/xrt/auxiliary/vk/vk_helpers.c
··· 1186 1186 #else 1187 1187 #error "need port" 1188 1188 #endif 1189 - if (requirements.size > image_native->size) { 1189 + 1190 + 1191 + if (handle_type == VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) { 1192 + /* 1193 + * Skip check in this case 1194 + * VUID-VkMemoryAllocateInfo-allocationSize-02383 1195 + * For AHardwareBuffer handles, the alloc size must be the size returned by 1196 + * vkGetAndroidHardwareBufferPropertiesANDROID for the Android hardware buffer 1197 + */ 1198 + } else if (requirements.size > image_native->size) { 1190 1199 VK_ERROR(vk, "size mismatch, exported %" PRIu64 " but requires %" PRIu64, image_native->size, 1191 1200 requirements.size); 1192 1201 return VK_ERROR_OUT_OF_DEVICE_MEMORY;