From 3837d401cc665eccf079eba5822b1a3eec565b81 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 3 May 2008 09:07:11 -0600 Subject: gallium: fix sampler->max_lod computation --- src/mesa/state_tracker/st_atom_sampler.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa/state_tracker') diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index b020d43505..379b41c654 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -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]; -- cgit v1.2.3