v3dv: don't support blitting of combined depth/stencil formats
authorIago Toral Quiroga <itoral@igalia.com>
Tue, 28 Apr 2020 08:31:21 +0000 (10:31 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 13 Oct 2020 21:21:30 +0000 (21:21 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>

src/broadcom/vulkan/v3dv_formats.c

index ccd12ae..b280c9c 100644 (file)
@@ -400,26 +400,32 @@ image_format_features(VkFormat vk_format,
 
    VkFormatFeatureFlags flags = 0;
 
+   bool is_combined_depth_stencil = (aspects & zs_aspects) == zs_aspects;
+
    /* Raster format is only supported for 1D textures, so let's just
     * always require optimal tiling for anything that requires sampling.
     */
    if (v3dv_format->tex_type != TEXTURE_DATA_FORMAT_NO &&
        tiling == VK_IMAGE_TILING_OPTIMAL) {
-      flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT |
-               VK_FORMAT_FEATURE_BLIT_SRC_BIT;
+      flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT;
+
+      if (!is_combined_depth_stencil)
+         flags |= VK_FORMAT_FEATURE_BLIT_SRC_BIT;
 
       if (v3dv_format->supports_filtering)
          flags |= VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_LINEAR_BIT;
    }
 
    if (v3dv_format->rt_type != V3D_OUTPUT_IMAGE_FORMAT_NO) {
-      flags |= VK_FORMAT_FEATURE_BLIT_DST_BIT;
       if (aspects & VK_IMAGE_ASPECT_COLOR_BIT) {
-         flags |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT;
+         flags |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
+                  VK_FORMAT_FEATURE_BLIT_DST_BIT;
          if (format_supports_blending(v3dv_format))
             flags |= VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BLEND_BIT;
       } else if (aspects & zs_aspects) {
          flags |= VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT;
+         if (!is_combined_depth_stencil)
+            flags |= VK_FORMAT_FEATURE_BLIT_DST_BIT;
       }
    }