anv/formats: Re-arrange the way se set some flag bits
authorJason Ekstrand <jason@jlekstrand.net>
Mon, 17 Jun 2019 02:20:41 +0000 (21:20 -0500)
committerJason Ekstrand <jason@jlekstrand.net>
Mon, 17 Jun 2019 22:32:26 +0000 (22:32 +0000)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_formats.c

index 4e15e626eed972a67915a554fa5d30b2732cf52a..70543e0cfdfc7137d1bbeb09afa62cb7b4aa8f16 100644 (file)
@@ -513,7 +513,11 @@ anv_get_image_format_features(const struct gen_device_info *devinfo,
       if (vk_tiling == VK_IMAGE_TILING_LINEAR)
          return 0;
 
-      flags |= VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT;
+      flags |= VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT |
+               VK_FORMAT_FEATURE_BLIT_SRC_BIT |
+               VK_FORMAT_FEATURE_BLIT_DST_BIT |
+               VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
+               VK_FORMAT_FEATURE_TRANSFER_DST_BIT;
 
       if (aspects == VK_IMAGE_ASPECT_DEPTH_BIT || devinfo->gen >= 8)
          flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
@@ -521,11 +525,6 @@ anv_get_image_format_features(const struct gen_device_info *devinfo,
       if ((aspects & VK_IMAGE_ASPECT_DEPTH_BIT) && devinfo->gen >= 9)
          flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT;
 
-      flags |= VK_FORMAT_FEATURE_BLIT_SRC_BIT |
-               VK_FORMAT_FEATURE_BLIT_DST_BIT |
-               VK_FORMAT_FEATURE_TRANSFER_SRC_BIT |
-               VK_FORMAT_FEATURE_TRANSFER_DST_BIT;
-
       return flags;
    }