From bf6c1b74705243efdd43f07d381768fceede1f91 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Tue, 12 Jun 2012 21:38:59 +0300 Subject: [PATCH] meta: texture rectangle textures may not have mipmaps 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 Reviewed-by: Brian Paul Reviewed-by: Kenneth Graunke --- 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 850a2b4d690..d36b1a3b8a3 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -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) { -- 2.30.2