nv50: aniso
authorBen Skeggs <skeggsb@gmail.com>
Tue, 13 Jan 2009 00:55:06 +0000 (10:55 +1000)
committerBen Skeggs <skeggsb@gmail.com>
Tue, 13 Jan 2009 03:57:22 +0000 (13:57 +1000)
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nv50/nv50_state.c

index b46619d78612352b858c2514b63e6fd9b5e402b1..381b3e2f39276d9b72f607e2db3388d9c31dde8e 100644 (file)
@@ -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:
index 95f9d408b5e45fc709edad3f6620da00c2d5b510..cabe54bde3a9d78ff406130efabfc1986757d4dc 100644 (file)
@@ -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;
 }