aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_state.c
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2009-05-28 15:47:54 +1000
committerBen Skeggs <[email protected]>2009-05-28 16:06:25 +1000
commit534f1e8f022ea7408c2ad49013e8f2446aa16364 (patch)
tree42a47e5e5082f0bcb1985635e454345d78e0b554 /src/gallium/drivers/nv50/nv50_state.c
parentc11c107f7d8f289f0cb83968c265fb78a274024a (diff)
nv50: some mipmapping fixes
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_state.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_state.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c
index ba852194cdd..9d41ef55b0f 100644
--- a/src/gallium/drivers/nv50/nv50_state.c
+++ b/src/gallium/drivers/nv50/nv50_state.c
@@ -137,8 +137,9 @@ nv50_sampler_state_create(struct pipe_context *pipe,
const struct pipe_sampler_state *cso)
{
unsigned *tsc = CALLOC(8, sizeof(unsigned));
+ float limit;
- tsc[0] = (0x00024000 |
+ tsc[0] = (0x00026000 |
(wrap_mode(cso->wrap_s) << 0) |
(wrap_mode(cso->wrap_t) << 3) |
(wrap_mode(cso->wrap_r) << 6));
@@ -202,6 +203,12 @@ nv50_sampler_state_create(struct pipe_context *pipe,
tsc[0] |= (nvgl_comparison_op(cso->compare_func) & 0x7);
}
+ limit = CLAMP(cso->lod_bias, -16.0, 15.0);
+ tsc[1] |= ((int)(limit * 256.0) & 0x1fff) << 11;
+
+ tsc[2] |= ((int)CLAMP(cso->max_lod, 0.0, 15.0) << 20) |
+ ((int)CLAMP(cso->min_lod, 0.0, 15.0) << 8);
+
return (void *)tsc;
}