gallium: fix sampler->max_lod computation
authorBrian Paul <brian.paul@tungstengraphics.com>
Sat, 3 May 2008 15:07:11 +0000 (09:07 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Sat, 3 May 2008 15:07:11 +0000 (09:07 -0600)
src/mesa/state_tracker/st_atom_sampler.c

index b020d435056cc11ec121e384753a232c7e7a826b..379b41c654fa84732f54dfd217e0877d2929de07 100644 (file)
@@ -148,8 +148,9 @@ update_samplers(struct st_context *st)
             sampler->normalized_coords = 1;
 
          sampler->lod_bias = st->ctx->Texture.Unit[su].LodBias;
-         sampler->min_lod = MAX2(0, texobj->MinLod);
-         sampler->max_lod = MIN2(texobj->MaxLevel, texobj->MaxLod);
+         sampler->min_lod = MAX2(0.0f, texobj->MinLod);
+         sampler->max_lod = MIN2(texobj->MaxLevel - texobj->BaseLevel,
+                                 texobj->MaxLod);
 
          sampler->border_color[0] = texobj->BorderColor[RCOMP];
          sampler->border_color[1] = texobj->BorderColor[GCOMP];