Mesa (master): radeonsi: simplify DCC format categories

Marek Olšák mareko at kemper.freedesktop.org
Wed Mar 28 22:46:08 UTC 2018


Module: Mesa
Branch: master
Commit: 025105453a807a76754c6a714ef29df7068608e5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=025105453a807a76754c6a714ef29df7068608e5

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Mon Mar 26 18:52:23 2018 -0400

radeonsi: simplify DCC format categories

Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>

---

 src/gallium/drivers/radeon/r600_texture.c | 29 +++++++++--------------------
 1 file changed, 9 insertions(+), 20 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_texture.c b/src/gallium/drivers/radeon/r600_texture.c
index 1614df63c9..eb6706c9dc 100644
--- a/src/gallium/drivers/radeon/r600_texture.c
+++ b/src/gallium/drivers/radeon/r600_texture.c
@@ -1882,15 +1882,12 @@ static const struct u_resource_vtbl r600_texture_vtbl =
 /* DCC channel type categories within which formats can be reinterpreted
  * while keeping the same DCC encoding. The swizzle must also match. */
 enum dcc_channel_type {
-	dcc_channel_float32,
-	dcc_channel_uint32,
-	dcc_channel_sint32,
-	dcc_channel_float16,
-	dcc_channel_uint16,
-	dcc_channel_sint16,
+	dcc_channel_float,
+	/* uint and sint can be merged if we never use TC-compatible DCC clear
+	 * encoding with the clear value of 1. */
+	dcc_channel_uint,
+	dcc_channel_sint,
 	dcc_channel_uint_10_10_10_2,
-	dcc_channel_uint8,
-	dcc_channel_sint8,
 	dcc_channel_incompatible,
 };
 
@@ -1909,23 +1906,15 @@ vi_get_dcc_channel_type(const struct util_format_description *desc)
 
 	switch (desc->channel[i].size) {
 	case 32:
-		if (desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT)
-			return dcc_channel_float32;
-		if (desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED)
-			return dcc_channel_uint32;
-		return dcc_channel_sint32;
 	case 16:
+	case 8:
 		if (desc->channel[i].type == UTIL_FORMAT_TYPE_FLOAT)
-			return dcc_channel_float16;
+			return dcc_channel_float;
 		if (desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED)
-			return dcc_channel_uint16;
-		return dcc_channel_sint16;
+			return dcc_channel_uint;
+		return dcc_channel_sint;
 	case 10:
 		return dcc_channel_uint_10_10_10_2;
-	case 8:
-		if (desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED)
-			return dcc_channel_uint8;
-		return dcc_channel_sint8;
 	default:
 		return dcc_channel_incompatible;
 	}




More information about the mesa-commit mailing list