Mesa (master): st/mesa: fix non-mipmap lastLevel calculation.

Cooper Yuan cooperyuan at kemper.freedesktop.org
Thu Oct 1 01:56:52 UTC 2009


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

Author: Cooper Yuan <cooperyuan at gmail.com>
Date:   Thu Oct  1 17:54:27 2009 +0800

st/mesa: fix non-mipmap lastLevel calculation.

reviewed by Brian Paul.

---

 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 771a0e2..9a634bb 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -1766,7 +1766,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]);




More information about the mesa-commit mailing list