Merge branch 'mesa_7_7_branch'
[mesa.git] / src / gallium / drivers / nv50 / nv50_state.c
index 4283808ed93e8476581ff353bd1dea1a17464eee..07318f23947bc34ba33d37527e2729e885e8b18e 100644 (file)
@@ -146,6 +146,7 @@ nv50_sampler_state_create(struct pipe_context *pipe,
                  (wrap_mode(cso->wrap_r) << 6));
 
        switch (cso->mag_img_filter) {
+       case PIPE_TEX_FILTER_ANISO:
        case PIPE_TEX_FILTER_LINEAR:
                tsc[1] |= NV50TSC_1_1_MAGF_LINEAR;
                break;
@@ -156,6 +157,7 @@ nv50_sampler_state_create(struct pipe_context *pipe,
        }
 
        switch (cso->min_img_filter) {
+       case PIPE_TEX_FILTER_ANISO:
        case PIPE_TEX_FILTER_LINEAR:
                tsc[1] |= NV50TSC_1_1_MINF_LINEAR;
                break;
@@ -183,21 +185,15 @@ nv50_sampler_state_create(struct pipe_context *pipe,
        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);
+       else {
+               tsc[0] |= (int)(cso->max_anisotropy * 0.5f) << 20;
+
+               if (cso->max_anisotropy >= 4.0)
+                       tsc[1] |= NV50TSC_1_1_UNKN_ANISO_35;
+               else
+               if (cso->max_anisotropy >= 2.0)
+                       tsc[1] |= NV50TSC_1_1_UNKN_ANISO_15;
+       }
 
        if (cso->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) {
                tsc[0] |= (1 << 8);
@@ -276,6 +272,9 @@ nv50_rasterizer_state_create(struct pipe_context *pipe,
        so_method(so, tesla, 0x1684, 1);
        so_data  (so, cso->flatshade_first ? 0 : 1);
 
+       so_method(so, tesla, NV50TCL_VERTEX_TWO_SIDE_ENABLE, 1);
+       so_data  (so, cso->light_twoside);
+
        so_method(so, tesla, NV50TCL_LINE_WIDTH, 1);
        so_data  (so, fui(cso->line_width));
        so_method(so, tesla, NV50TCL_LINE_SMOOTH_ENABLE, 1);
@@ -294,6 +293,9 @@ nv50_rasterizer_state_create(struct pipe_context *pipe,
        so_method(so, tesla, NV50TCL_POINT_SIZE, 1);
        so_data  (so, fui(cso->point_size));
 
+       so_method(so, tesla, NV50TCL_POINT_SPRITE_ENABLE, 1);
+       so_data  (so, cso->point_sprite);
+
        so_method(so, tesla, NV50TCL_POLYGON_MODE_FRONT, 3);
        if (cso->front_winding == PIPE_WINDING_CCW) {
                so_data(so, nvgl_polygon_mode(cso->fill_ccw));
@@ -646,9 +648,9 @@ nv50_init_state_functions(struct nv50_context *nv50)
        nv50->pipe.delete_blend_state = nv50_blend_state_delete;
 
        nv50->pipe.create_sampler_state = nv50_sampler_state_create;
-       nv50->pipe.bind_sampler_states = nv50_sampler_state_bind;
+       nv50->pipe.bind_fragment_sampler_states = nv50_sampler_state_bind;
        nv50->pipe.delete_sampler_state = nv50_sampler_state_delete;
-       nv50->pipe.set_sampler_textures = nv50_set_sampler_texture;
+       nv50->pipe.set_fragment_sampler_textures = nv50_set_sampler_texture;
 
        nv50->pipe.create_rasterizer_state = nv50_rasterizer_state_create;
        nv50->pipe.bind_rasterizer_state = nv50_rasterizer_state_bind;