diff --git a/src/vulkan/runtime/vk_image.c b/src/vulkan/runtime/vk_image.c index e4bd997a215..b33d10e7e94 100644 --- a/src/vulkan/runtime/vk_image.c +++ b/src/vulkan/runtime/vk_image.c @@ -23,8 +23,6 @@ #include "vk_image.h" -#include - #ifndef _WIN32 #include #endif @@ -40,6 +38,11 @@ #include "vk_util.h" #include "vulkan/wsi/wsi_common.h" +#ifdef ANDROID +#include "vk_android.h" +#include +#endif + void vk_image_init(struct vk_device *device, struct vk_image *image, @@ -97,6 +100,8 @@ vk_image_init(struct vk_device *device, #endif #ifdef ANDROID + image->ahardware_buffer_format = 0; + const VkExternalFormatANDROID *ext_format = vk_find_struct_const(pCreateInfo->pNext, EXTERNAL_FORMAT_ANDROID); if (ext_format && ext_format->externalFormat != 0) { diff --git a/src/vulkan/runtime/vk_image.h b/src/vulkan/runtime/vk_image.h index bd120da646a..a3db8ed0e43 100644 --- a/src/vulkan/runtime/vk_image.h +++ b/src/vulkan/runtime/vk_image.h @@ -70,6 +70,13 @@ struct vk_image { #endif #ifdef ANDROID + /* AHARDWAREBUFFER_FORMAT for this image or 0 + * + * A default is provided by the Vulkan runtime code based on the VkFormat + * but it may be overridden by the driver as needed. + */ + unsigned ahardware_buffer_format; + /* VK_ANDROID_external_memory_android_hardware_buffer */ uint64_t android_external_format; #endif