From 9755539116fd0b818cc0636a6d6ed10b19b639be Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Jul 2010 13:04:47 -0600 Subject: [PATCH] st/mesa: fix sampler max_lod computation This change makes gallium behave like other GL implementations and fixes a conformance failure. --- src/mesa/state_tracker/st_atom_sampler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index 92fe72d..f147d76 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. -- 2.7.4