Avoid transitions from VK_IMAGE_LAYOUT_UNDEFINED for external images

Unfortunetly, Android does not yet have a mechanism for sharing the
expected VkImageLayout when passing around AHardwareBuffer-s so
many existing users that import AHardwareBuffer-s into VkImage-s
seem to use VK_IMAGE_LAYOUT_UNDEFINED. However, the Vulkan spec's
image layout transition sections says "If the old layout is
VK_IMAGE_LAYOUT_UNDEFINED, the contents of that range may be
discarded." Some Vulkan drivers have been observed to actually
perform the discard which leads to AHardwareBuffer-s being
unintentionally cleared. See go/ahb-vkimagelayout for a more
thorough write up.

Bug: b/236179471
Test: `launch_cvd --gpu_mode=gfxstream`
Test: `launch_cvd --gpu_mode=gfxstream` with WIP ANGLE
Change-Id: Id55b5d395879012e36e529ceb512035abac77929
3 files changed