diff options
-rw-r--r-- | src/mesa/swrast/s_texfilter.c | 15 |
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; } |