From: Eric Anholt Date: Mon, 10 Jan 2011 18:50:36 +0000 (-0800) Subject: meta: Don't tweak BaseLevel when doing glGenerateMipmap(). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd4a2e9209e13878d052dfb8e981fd798c6e4e40;p=mesa.git meta: Don't tweak BaseLevel when doing glGenerateMipmap(). We don't need to worry about levels other than MaxLevel because we're minifying -- the lower levels (higher detail) won't contribute to the result. By changing BaseLevel, we forced hardware that doesn't support BaseLevel != 0 to relayout the texture object. --- diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index cdb2500f7c2..3e699912bb4 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2260,7 +2260,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, const GLuint maxLevel = texObj->MaxLevel; const GLenum minFilterSave = texObj->MinFilter; const GLenum magFilterSave = texObj->MagFilter; - const GLint baseLevelSave = texObj->BaseLevel; const GLint maxLevelSave = texObj->MaxLevel; const GLboolean genMipmapSave = texObj->GenerateMipmap; const GLenum wrapSSave = texObj->WrapS; @@ -2496,8 +2495,7 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, } } - /* limit sampling to src level */ - _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel); + /* limit minification to src level */ _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel); /* Set to draw into the current dstLevel */ @@ -2549,7 +2547,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilterSave); _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilterSave); - _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, baseLevelSave); _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave); _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, genMipmapSave); _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave);