radv: Support DCC modifiers fully.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 9 Mar 2021 02:32:32 +0000 (03:32 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 8 Apr 2021 22:29:12 +0000 (22:29 +0000)
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9998>

src/amd/vulkan/radv_formats.c
src/amd/vulkan/radv_image.c

index 0ac7d02..cbb6d5e 100644 (file)
@@ -1156,10 +1156,7 @@ radv_get_modifier_flags(struct radv_physical_device *dev,
                return 0;
 
        if (ac_modifier_has_dcc(modifier)) {
-               features &= ~(VK_FORMAT_FEATURE_TRANSFER_DST_BIT |
-                             VK_FORMAT_FEATURE_COLOR_ATTACHMENT_BIT |
-                             VK_FORMAT_FEATURE_DEPTH_STENCIL_ATTACHMENT_BIT |
-                             VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT);
+               features &= ~VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT;
 
                if (dev->instance->debug_flags & (RADV_DEBUG_NO_DCC | RADV_DEBUG_NO_DISPLAY_DCC))
                        return 0;
index 6335e50..58324c3 100644 (file)
@@ -1360,6 +1360,10 @@ radv_image_alloc_single_sample_cmask(const struct radv_device *device,
 static void
 radv_image_alloc_values(const struct radv_device *device, struct radv_image *image)
 {
+       /* images with modifiers can be potentially imported */
+       if (image->tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT)
+               return;
+
        if (radv_image_has_cmask(image) || radv_image_has_dcc(image)) {
                image->fce_pred_offset = image->size;
                image->size += 8 * image->info.levels;