From 131f4ca7cc80fb71ec8dd07c8e15c60136718b6c Mon Sep 17 00:00:00 2001 From: Lucas Fryzek Date: Tue, 19 Aug 2025 07:49:18 -0400 Subject: [PATCH] vulkan/android: Add rp_attachment_has_external_format helper Reviewed-by: Yiwei Zhang Part-of: --- src/vulkan/runtime/vk_android.c | 10 ++++++++++ src/vulkan/runtime/vk_android.h | 10 ++++++++++ 2 files changed, 20 insertions(+) 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