const VkSamplerYcbcrConversionInfo *conv_info =
vk_find_struct_const(pCreateInfo->pNext, SAMPLER_YCBCR_CONVERSION_INFO);
-#ifdef ANDROID
- /* If image has an external format, the pNext chain must contain an
- * instance of VKSamplerYcbcrConversionInfo with a conversion object
- * created with the same external format as image."
- */
- assert(!image->vk.android_external_format || conv_info);
-#endif
-
if (conv_info) {
VK_FROM_HANDLE(vk_ycbcr_conversion, conversion, conv_info->conversion);
conv_format = conversion->state.format;
}
-#ifdef ANDROID
- /* "If image has an external format, format must be VK_FORMAT_UNDEFINED." */
- assert(!image->vk.android_external_format ||
- pCreateInfo->format == VK_FORMAT_UNDEFINED);
-#endif
-
/* Format is undefined, this can happen when using external formats. Set
* view format from the passed conversion info.
*/
const VkSamplerYcbcrConversionInfo *conv_info =
vk_find_struct_const(pCreateInfo->pNext, SAMPLER_YCBCR_CONVERSION_INFO);
-#ifdef ANDROID
- /* If image has an external format, the pNext chain must contain an
- * instance of VKSamplerYcbcrConversionInfo with a conversion object
- * created with the same external format as image."
- */
- assert(!image->vk.android_external_format || conv_info);
-#endif
-
if (conv_info) {
VK_FROM_HANDLE(vk_ycbcr_conversion, conversion, conv_info->conversion);
conv_format = conversion->state.format;
}
-#ifdef ANDROID
- /* "If image has an external format, format must be VK_FORMAT_UNDEFINED." */
- assert(!image->vk.android_external_format ||
- pCreateInfo->format == VK_FORMAT_UNDEFINED);
-#endif
-
/* Format is undefined, this can happen when using external formats. Set
* view format from the passed conversion info.
*/
assert(image->format == VK_FORMAT_UNDEFINED);
assert(image->external_handle_types &
VK_EXTERNAL_MEMORY_HANDLE_TYPE_ANDROID_HARDWARE_BUFFER_BIT_ANDROID);
- image->android_external_format = ext_format->externalFormat;
- } else {
- image->android_external_format = 0;
+ vk_image_set_format(image, (VkFormat)ext_format->externalFormat);
}
#endif
}
VkImageCreateFlags create_flags;
VkImageType image_type;
+
+ /* format is from VkImageCreateInfo::format or
+ * VkExternalFormatANDROID::externalFormat. This works because only one of
+ * them can be defined and the runtime uses VkFormat for external formats.
+ */
VkFormat format;
+
VkExtent3D extent;
uint32_t mip_levels;
uint32_t array_layers;
* 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
};
VK_DEFINE_NONDISP_HANDLE_CASTS(vk_image, base, VkImage,