[Mesa-dev] [PATCH v2 19/21] meta: texture rectangle textures may not have mipmaps

Pauli Nieminen pauli.nieminen at linux.intel.com
Tue Jun 12 11:38:59 PDT 2012


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.

Signed-off-by: Pauli Nieminen <pauli.nieminen at linux.intel.com>
Reviewed-by: Brian Paul <brianp at vmware.com>
---
 src/mesa/drivers/common/meta.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index c8dd80a..6fe1fac 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3323,8 +3323,10 @@ decompress_texture_image(struct gl_context *ctx,
       const GLenum srgbSave = texObj->Sampler.sRGBDecode;
 
       /* 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);
+      }
       /* nearest filtering */
       _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
       _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-- 
1.7.9.5



More information about the mesa-dev mailing list