From: Chad Versace Date: Thu, 28 Jan 2016 14:28:01 +0000 (-0800) Subject: anv/image: Update usage flags for multisample images X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2bab3cd681d1201556f23043deb24681c6d0f3e3;p=mesa.git anv/image: Update usage flags for multisample images Meta resolves multisample images by binding them as textures. Therefore we must add VK_IMAGE_USAGE_SAMPLED_BIT. --- diff --git a/src/vulkan/anv_image.c b/src/vulkan/anv_image.c index febfaa42539..6cc5700c21e 100644 --- a/src/vulkan/anv_image.c +++ b/src/vulkan/anv_image.c @@ -158,6 +158,12 @@ anv_image_get_full_usage(const VkImageCreateInfo *info) { VkImageUsageFlags usage = info->usage; + if (info->samples > 1 && + (usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)) { + /* Meta will resolve the image by binding it as a texture. */ + usage |= VK_IMAGE_USAGE_SAMPLED_BIT; + } + if (usage & VK_IMAGE_USAGE_TRANSFER_SRC_BIT) { /* Meta will transfer from the image by binding it as a texture. */ usage |= VK_IMAGE_USAGE_SAMPLED_BIT;