return anv_image_from_external(device, pCreateInfo, create_info,
pAllocator, pImage);
+ bool use_external_format = false;
+ const struct VkExternalFormatANDROID *ext_format =
+ vk_find_struct_const(pCreateInfo->pNext, EXTERNAL_FORMAT_ANDROID);
+
+ /* "If externalFormat is zero, the effect is as if the
+ * VkExternalFormatANDROID structure was not present. Otherwise, the image
+ * will have the specified external format."
+ */
+ if (ext_format && ext_format->externalFormat != 0)
+ use_external_format = true;
+
const VkNativeBufferANDROID *gralloc_info =
vk_find_struct_const(pCreateInfo->pNext, NATIVE_BUFFER_ANDROID);
if (gralloc_info)
return anv_image_create(device,
&(struct anv_image_create_info) {
.vk_info = pCreateInfo,
+ .external_format = use_external_format,
},
pAllocator,
pImage);