vulkan/android: Add rp_attachment_has_external_format helper

Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37177>
This commit is contained in:
Lucas Fryzek 2025-08-19 07:49:18 -04:00 committed by Marge Bot
parent bbcafa630f
commit 131f4ca7cc
2 changed files with 20 additions and 0 deletions

View file

@ -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 */

View file

@ -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