Mesa (master): st/mesa: fix sampler max_lod computation

Brian Paul brianp at kemper.freedesktop.org
Wed Jul 7 19:06:00 UTC 2010


Module: Mesa
Branch: master
Commit: 9755539116fd0b818cc0636a6d6ed10b19b639be
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9755539116fd0b818cc0636a6d6ed10b19b639be

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Jul  7 13:04:47 2010 -0600

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 files changed, 2 insertions(+), 1 deletions(-)

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.




More information about the mesa-commit mailing list