nvk: Enable SEPARATE_RECONSTRUCTION_FILTER_BIT for multi-planar formats only
authorMohamed Ahmed <mohamedahmedegypt2001@gmail.com>
Thu, 10 Aug 2023 16:44:01 +0000 (19:44 +0300)
committerMarge Bot <emma+marge@anholt.net>
Wed, 16 Aug 2023 22:36:27 +0000 (22:36 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24614>

src/nouveau/vulkan/nvk_image.c

index 90ebbae..60be1a7 100644 (file)
@@ -112,11 +112,17 @@ nvk_get_image_format_features(struct nvk_physical_device *pdev,
 
    /* These are supported on all YCbCr formats */
    features |= VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT |
-               VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT |
-               VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT;
-
-   if (ycbcr_info->n_planes > 1)
-      features |= VK_FORMAT_FEATURE_DISJOINT_BIT;
+               VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT;
+
+   if (ycbcr_info->n_planes > 1) {
+      /* DISJOINT_BIT implies that each plane has its own separate binding,
+       * while SEPARATE_RECONSTRUCTION_FILTER_BIT implies that luma and chroma
+       * each have their own, separate filters, so these two bits make sense
+       * for multi-planar formats only.
+       */
+      features |= VK_FORMAT_FEATURE_DISJOINT_BIT |
+                  VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT;
+   }
 
    if (cosited_chroma)
       features |= VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT;