diff --git a/src/vulkan/runtime/vk_android.c b/src/vulkan/runtime/vk_android.c index 86d79c937de..505ada00b46 100644 --- a/src/vulkan/runtime/vk_android.c +++ b/src/vulkan/runtime/vk_android.c @@ -1061,4 +1061,14 @@ vk_android_get_ahb_buffer_properties( }; } +bool vk_android_rp_attachment_has_external_format( + const VkAttachmentDescription2 *desc) +{ + const VkExternalFormatANDROID *format_info = + vk_find_struct_const(desc->pNext, + EXTERNAL_FORMAT_ANDROID); + return (desc->format == VK_FORMAT_UNDEFINED) && + (format_info != NULL); +} + #endif /* ANDROID_API_LEVEL >= 26 */ diff --git a/src/vulkan/runtime/vk_android.h b/src/vulkan/runtime/vk_android.h index cfd6f83e8ad..05258786b8d 100644 --- a/src/vulkan/runtime/vk_android.h +++ b/src/vulkan/runtime/vk_android.h @@ -110,6 +110,9 @@ void vk_android_get_ahb_buffer_properties( const VkPhysicalDeviceExternalBufferInfo *info, VkExternalBufferProperties *props); +bool vk_android_rp_attachment_has_external_format( + const VkAttachmentDescription2 *desc); + #else /* defined(VK_USE_PLATFORM_ANDROID_KHR) && ANDROID_API_LEVEL >= 26 */ static inline uint64_t @@ -169,6 +172,13 @@ vk_android_get_ahb_buffer_properties( { } +static bool +vk_android_rp_attachment_has_external_format( + const VkAttachmentDescription2 *desc) +{ + return false; +} + #endif /* ANDROID_API_LEVEL >= 26 */ #ifdef __cplusplus