Module: Mesa
Branch: mesa_7_6_branch
Commit: 495628bc5c3879ee759f9a1bc7e2abc720df75a9
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=495628bc5c3879ee759f9a1bc7e2abc720df75a9

Author: Brian Paul <[email protected]>
Date:   Thu Oct  1 13:34:49 2009 -0600

st/mesa: fix non-mipmap lastLevel calculation.

reviewed by Brian Paul.
(cherry picked from master, commit ae2daacbac7242938cffe0e2409071e030e00863)

---

 src/mesa/state_tracker/st_cb_texture.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_texture.c 
b/src/mesa/state_tracker/st_cb_texture.c
index b13e377..50675b5 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1775,7 +1775,11 @@ st_finalize_texture(GLcontext *ctx,
        * incomplete.  In that case, we'll have set stObj->lastLevel before
        * we get here.
        */
-      stObj->lastLevel = stObj->base._MaxLevel - stObj->base.BaseLevel;
+      if (stObj->base.MinFilter == GL_LINEAR ||
+          stObj->base.MinFilter == GL_NEAREST)
+         stObj->lastLevel = stObj->base.BaseLevel;
+      else
+         stObj->lastLevel = stObj->base._MaxLevel - stObj->base.BaseLevel;
    }
 
    firstImage = st_texture_image(stObj->base.Image[0][stObj->base.BaseLevel]);

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to