From: Brian Paul Date: Wed, 7 Jul 2010 19:04:47 +0000 (-0600) Subject: st/mesa: fix sampler max_lod computation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9755539116fd0b818cc0636a6d6ed10b19b639be;p=mesa.git st/mesa: fix sampler max_lod computation This change makes gallium behave like other GL implementations and fixes a conformance failure. --- diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index 92fe72d4df6..f147d768084 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -199,7 +199,8 @@ update_samplers(struct st_context *st) if (sampler->min_lod < texobj->BaseLevel) sampler->min_lod = texobj->BaseLevel; - sampler->max_lod = MIN2((GLfloat) texobj->MaxLevel, texobj->MaxLod); + sampler->max_lod = MIN2((GLfloat) texobj->MaxLevel, + (texobj->MaxLod + texobj->BaseLevel)); if (sampler->max_lod < sampler->min_lod) { /* The GL spec doesn't seem to specify what to do in this case. * Swap the values.