summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCooper Yuan <[email protected]>2009-10-01 17:54:27 +0800
committerCooper Yuan <[email protected]>2009-10-01 17:54:27 +0800
commitae2daacbac7242938cffe0e2409071e030e00863 (patch)
tree189eec43ee9660f654657a13c142175f6ed8b25f
parent81a62edc088278e97288db7b17f6b485af8976b0 (diff)
st/mesa: fix non-mipmap lastLevel calculation.
reviewed by Brian Paul.
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c6
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 771a0e2bbdf..9a634bb9302 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]);