summaryrefslogtreecommitdiff
path: root/src/mesa/swrast
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-10-04 19:59:23 -0600
committerBrian Paul <brianp@vmware.com>2010-10-04 19:59:46 -0600
commitfb5e6f88fc426e53af26e98d1c336222a8952cc5 (patch)
tree8ed83843ec76ce3090e544dec621e479e13fbb89 /src/mesa/swrast
parentd0408cf55d9e8d1d376bd844386ef5c9789a3597 (diff)
swrast: fix choose_depth_texture_level() to respect mipmap filtering state
NOTE: this is a candidate for the 7.9 branch.
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_texfilter.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index de694c31bf..e5ffe8fa5c 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -2975,11 +2975,16 @@ choose_depth_texture_level(const struct gl_texture_object *tObj, GLfloat lambda)
{
GLint level;
- lambda = CLAMP(lambda, tObj->MinLod, tObj->MaxLod);
-
- level = (GLint) lambda;
-
- level = CLAMP(level, tObj->BaseLevel, tObj->_MaxLevel);
+ if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) {
+ /* no mipmapping - use base level */
+ level = tObj->BaseLevel;
+ }
+ else {
+ /* choose mipmap level */
+ lambda = CLAMP(lambda, tObj->MinLod, tObj->MaxLod);
+ level = (GLint) lambda;
+ level = CLAMP(level, tObj->BaseLevel, tObj->_MaxLevel);
+ }
return level;
}