diff options
author | Ben Skeggs <skeggsb@gmail.com> | 2008-02-13 19:33:41 +1100 |
---|---|---|
committer | Ben Skeggs <skeggsb@gmail.com> | 2008-02-13 19:33:41 +1100 |
commit | 263de4b814eb78cc971ad28f173985b61b77465c (patch) | |
tree | 0f7f9033f8b2b2572dfdf21d0264aefef79a9de7 /src/mesa/pipe/nv40/nv40_state.c | |
parent | 6be095ae15d411c82f7417c98a87867dbdf1947b (diff) |
nv40: attempt at obeying sampler min_lod/max_lod/lod_bias
Diffstat (limited to 'src/mesa/pipe/nv40/nv40_state.c')
-rw-r--r-- | src/mesa/pipe/nv40/nv40_state.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mesa/pipe/nv40/nv40_state.c b/src/mesa/pipe/nv40/nv40_state.c index 80e94737ef..bcd244528d 100644 --- a/src/mesa/pipe/nv40/nv40_state.c +++ b/src/mesa/pipe/nv40/nv40_state.c @@ -193,6 +193,20 @@ nv40_sampler_state_create(struct pipe_context *pipe, ps->filt = filter; + { + float limit; + + limit = CLAMP(cso->lod_bias, -16.0, 15.0); + ps->filt |= (int)(cso->lod_bias * 256.0) & 0x1fff; + + limit = CLAMP(cso->max_lod, 0.0, 15.0); + ps->en |= (int)(limit * 256.0) << 7; + + limit = CLAMP(cso->min_lod, 0.0, 15.0); + ps->en |= (int)(limit * 256.0) << 19; + } + + if (cso->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) { switch (cso->compare_func) { case PIPE_FUNC_NEVER: |