meta: texture rectangle textures may not have mipmaps
authorPauli Nieminen <pauli.nieminen@linux.intel.com>
Tue, 12 Jun 2012 18:38:59 +0000 (21:38 +0300)
committerKenneth Graunke <kenneth@whitecape.org>
Sun, 12 Aug 2012 23:18:46 +0000 (16:18 -0700)
Avoid INVALID_OPERATION error if decompressing rectangle texture.
Setting mipmap level limits for those textures is error that must not be
hit by meta code to mislead user.

[v3/Kayden]: Resolve conflicts due to Eric picking a subset of Pauli's
original changes.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/common/meta.c

index 850a2b4d6903358a9012cfede7feabeb4104063e..d36b1a3b8a32799fcde5e21328f4deb3cd41d502 100644 (file)
@@ -3410,8 +3410,10 @@ decompress_texture_image(struct gl_context *ctx,
       const GLint maxLevelSave = texObj->MaxLevel;
 
       /* restrict sampling to the texture level of interest */
-      _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, texImage->Level);
-      _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, texImage->Level);
+      if (target != GL_TEXTURE_RECTANGLE_ARB) {
+         _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, texImage->Level);
+         _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, texImage->Level);
+      }
 
       /* No sRGB decode or encode.*/
       if (ctx->Extensions.EXT_framebuffer_sRGB) {