···11861186#else
11871187#error "need port"
11881188#endif
11891189- if (requirements.size > image_native->size) {
11891189+11901190+11911191+ if (handle_type == VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID) {
11921192+ /*
11931193+ * Skip check in this case
11941194+ * VUID-VkMemoryAllocateInfo-allocationSize-02383
11951195+ * For AHardwareBuffer handles, the alloc size must be the size returned by
11961196+ * vkGetAndroidHardwareBufferPropertiesANDROID for the Android hardware buffer
11971197+ */
11981198+ } else if (requirements.size > image_native->size) {
11901199 VK_ERROR(vk, "size mismatch, exported %" PRIu64 " but requires %" PRIu64, image_native->size,
11911200 requirements.size);
11921201 return VK_ERROR_OUT_OF_DEVICE_MEMORY;