anv/image: Update usage flags for multisample images
authorChad Versace <chad.versace@intel.com>
Thu, 28 Jan 2016 14:28:01 +0000 (06:28 -0800)
committerChad Versace <chad.versace@intel.com>
Thu, 28 Jan 2016 18:03:00 +0000 (10:03 -0800)
Meta resolves multisample images by binding them as textures. Therefore
we must add VK_IMAGE_USAGE_SAMPLED_BIT.

src/vulkan/anv_image.c

index febfaa425390c94253c5ae7a9a44b75ae7d49bf9..6cc5700c21edbb19aab291fcad4c9ed2314f0720 100644 (file)
@@ -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;