From 8b9033ad0a007ffe76f0f691c5540ce1b7c28499 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Tue, 9 Mar 2021 03:32:32 +0100 Subject: [PATCH] radv: Support DCC modifiers fully. Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_formats.c | 5 +---- src/amd/vulkan/radv_image.c | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/amd/vulkan/radv_formats.c b/src/amd/vulkan/radv_formats.c index 0ac7d02703c..cbb6d5e9373 100644 --- a/src/amd/vulkan/radv_formats.c +++ b/src/amd/vulkan/radv_formats.c @@ -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; diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 6335e502840..58324c36dde 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -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;