[Mesa-dev] [PATCH 1/6] gallium/radeon: fix maximum texture anisotropy setup

Marek Olšák maraeo at gmail.com
Mon Apr 11 15:25:03 UTC 2016


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

We were overdoing it for non-power-of-two values.
---
 src/gallium/drivers/radeon/r600_pipe_common.h | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h
index ad8017a..d929f70 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.h
+++ b/src/gallium/drivers/radeon/r600_pipe_common.h
@@ -678,11 +678,15 @@ static inline bool r600_get_strmout_en(struct r600_common_context *rctx)
 
 static inline unsigned r600_tex_aniso_filter(unsigned filter)
 {
-	if (filter <= 1)   return 0;
-	if (filter <= 2)   return 1;
-	if (filter <= 4)   return 2;
-	if (filter <= 8)   return 3;
-	 /* else */        return 4;
+	if (filter < 2)
+		return 0;
+	if (filter < 4)
+		return 1;
+	if (filter < 8)
+		return 2;
+	if (filter < 16)
+		return 3;
+	return 4;
 }
 
 static inline unsigned r600_wavefront_size(enum radeon_family family)
-- 
2.5.0



More information about the mesa-dev mailing list