diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index c368d503a13..c67d1111122 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -903,9 +903,10 @@ check_memory_bindings(const struct anv_device *device, : ANV_IMAGE_MEMORY_BINDING_MAIN; /* Aliasing is incompatible with the private binding because it does not - * live in a VkDeviceMemory. + * live in a VkDeviceMemory. The one exception is swapchain images. */ assert(!(image->vk.create_flags & VK_IMAGE_CREATE_ALIAS_BIT) || + image->from_wsi || image->bindings[ANV_IMAGE_MEMORY_BINDING_PRIVATE].memory_range.size == 0); /* Check primary surface */ diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index d54c6c0848e..82e814fd3b4 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -3872,6 +3872,11 @@ struct anv_image { */ bool disjoint; + /** + * Image is a WSI image + */ + bool from_wsi; + /** * Image was imported from an struct AHardwareBuffer. We have to delay * final image creation until bind time. diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c index 725239ba8c0..afd634b1dc5 100644 --- a/src/vulkan/wsi/wsi_common.c +++ b/src/vulkan/wsi/wsi_common.c @@ -373,7 +373,7 @@ wsi_configure_image(const struct wsi_swapchain *chain, info->create = (VkImageCreateInfo) { .sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO, - .flags = 0, + .flags = VK_IMAGE_CREATE_ALIAS_BIT, .imageType = VK_IMAGE_TYPE_2D, .format = pCreateInfo->imageFormat, .extent = {