[Mesa-dev] [PATCH 4/4] radeonsi: relax DCC format compatibility contraints

Marek Olšák maraeo at gmail.com
Fri Apr 6 17:12:44 UTC 2018


From: Marek Olšák <marek.olsak at amd.com>

The swizzle has no effect on DCC encoding.
---
 src/gallium/drivers/radeonsi/si_texture.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c
index 5a29624f1fa..1f0de5e71ec 100644
--- a/src/gallium/drivers/radeonsi/si_texture.c
+++ b/src/gallium/drivers/radeonsi/si_texture.c
@@ -1926,38 +1926,32 @@ vi_get_dcc_channel_type(const struct util_format_description *desc)
 		return dcc_channel_incompatible;
 	}
 }
 
 /* Return if it's allowed to reinterpret one format as another with DCC enabled. */
 bool vi_dcc_formats_compatible(enum pipe_format format1,
 			       enum pipe_format format2)
 {
 	const struct util_format_description *desc1, *desc2;
 	enum dcc_channel_type type1, type2;
-	int i;
 
 	if (format1 == format2)
 		return true;
 
 	desc1 = util_format_description(format1);
 	desc2 = util_format_description(format2);
 
+	/* This constraint is only needed if we use the TC-compatible
+	 * DCC clear encoding with the clear value of 1. */
 	if (desc1->nr_channels != desc2->nr_channels)
 		return false;
 
-	/* Swizzles must be the same. */
-	for (i = 0; i < desc1->nr_channels; i++)
-		if (desc1->swizzle[i] <= PIPE_SWIZZLE_W &&
-		    desc2->swizzle[i] <= PIPE_SWIZZLE_W &&
-		    desc1->swizzle[i] != desc2->swizzle[i])
-			return false;
-
 	type1 = vi_get_dcc_channel_type(desc1);
 	type2 = vi_get_dcc_channel_type(desc2);
 
 	return type1 != dcc_channel_incompatible &&
 	       type2 != dcc_channel_incompatible &&
 	       type1 == type2;
 }
 
 bool vi_dcc_formats_are_incompatible(struct pipe_resource *tex,
 				     unsigned level,
-- 
2.15.1



More information about the mesa-dev mailing list