st/mesa: fix sampler max_lod computation
authorBrian Paul <brianp@vmware.com>
Wed, 7 Jul 2010 19:04:47 +0000 (13:04 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 7 Jul 2010 19:05:35 +0000 (13:05 -0600)
This change makes gallium behave like other GL implementations and fixes
a conformance failure.

src/mesa/state_tracker/st_atom_sampler.c

index 92fe72d4df60ba947a2694cccf80b90d5c61e43e..f147d76808469dcf86affa59d20bd90b179ae2e8 100644 (file)
@@ -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.