Mesa (gallium-0.2): nv50: aniso

Ben Skeggs darktama at kemper.freedesktop.org
Tue Jan 13 03:57:17 UTC 2009


Module: Mesa
Branch: gallium-0.2
Commit: f7c2010525a3fb37079c2cff51d4c593ef8e807b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f7c2010525a3fb37079c2cff51d4c593ef8e807b

Author: Ben Skeggs <skeggsb at gmail.com>
Date:   Tue Jan 13 10:55:06 2009 +1000

nv50: aniso

---

 src/gallium/drivers/nv50/nv50_screen.c |    2 +-
 src/gallium/drivers/nv50/nv50_state.c  |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c
index b46619d..381b3e2 100644
--- a/src/gallium/drivers/nv50/nv50_screen.c
+++ b/src/gallium/drivers/nv50/nv50_screen.c
@@ -98,7 +98,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, int param)
 	case PIPE_CAP_S3TC:
 		return 0;
 	case PIPE_CAP_ANISOTROPIC_FILTER:
-		return 0;
+		return 1;
 	case PIPE_CAP_POINT_SPRITE:
 		return 0;
 	case PIPE_CAP_MAX_RENDER_TARGETS:
diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c
index 95f9d40..cabe54b 100644
--- a/src/gallium/drivers/nv50/nv50_state.c
+++ b/src/gallium/drivers/nv50/nv50_state.c
@@ -175,6 +175,27 @@ nv50_sampler_state_create(struct pipe_context *pipe,
 		break;
 	}
 
+	if (cso->max_anisotropy >= 16.0)
+		tsc[0] |= (7 << 20);
+	else
+	if (cso->max_anisotropy >= 12.0)
+		tsc[0] |= (6 << 20);
+	else
+	if (cso->max_anisotropy >= 10.0)
+		tsc[0] |= (5 << 20);
+	else
+	if (cso->max_anisotropy >= 8.0)
+		tsc[0] |= (4 << 20);
+	else
+	if (cso->max_anisotropy >= 6.0)
+		tsc[0] |= (3 << 20);
+	else
+	if (cso->max_anisotropy >= 4.0)
+		tsc[0] |= (2 << 20);
+	else
+	if (cso->max_anisotropy >= 2.0)
+		tsc[0] |= (1 << 20);
+
 	return (void *)tsc;
 }
 




More information about the mesa-commit mailing list