Mesa (master): radeonsi: move blend choice out of loop in si_blit_decompress_color

Nicolai Hähnle nh at kemper.freedesktop.org
Wed Apr 27 16:16:55 UTC 2016


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

Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date:   Fri Apr 22 15:28:47 2016 -0500

radeonsi: move blend choice out of loop in si_blit_decompress_color

It does not depend on the level or layer.

Reviewed-by: Marek Olšák <marek.olsak at amd.com>

---

 src/gallium/drivers/radeonsi/si_blit.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index 32f953d..b87275d 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -309,6 +309,7 @@ static void si_blit_decompress_color(struct pipe_context *ctx,
 		bool need_dcc_decompress)
 {
 	struct si_context *sctx = (struct si_context *)ctx;
+	void* custom_blend;
 	unsigned layer, checked_last_layer, max_layer;
 	unsigned level_mask =
 		u_bit_consecutive(first_level, last_level - first_level + 1);
@@ -318,17 +319,16 @@ static void si_blit_decompress_color(struct pipe_context *ctx,
 	if (!level_mask)
 		return;
 
+	if (rtex->dcc_offset && need_dcc_decompress) {
+		custom_blend = sctx->custom_blend_dcc_decompress;
+	} else if (rtex->fmask.size) {
+		custom_blend = sctx->custom_blend_decompress;
+	} else {
+		custom_blend = sctx->custom_blend_fastclear;
+	}
+
 	while (level_mask) {
 		unsigned level = u_bit_scan(&level_mask);
-		void* custom_blend;
-
-		if (rtex->dcc_offset && need_dcc_decompress) {
-			custom_blend = sctx->custom_blend_dcc_decompress;
-		} else if (rtex->fmask.size) {
-			custom_blend = sctx->custom_blend_decompress;
-		} else {
-			custom_blend = sctx->custom_blend_fastclear;
-		}
 
 		/* The smaller the mipmap level, the less layers there are
 		 * as far as 3D textures are concerned. */




More information about the mesa-commit mailing list