[Mesa-dev] [PATCH 3/4] Don't set srcLevel on GL_TEXTURE_RECTANGLE_ARB targets

Brian Paul brianp at vmware.com
Tue Apr 27 14:56:06 PDT 2010


Pierre Willenbrock wrote:
> ---
>  src/mesa/drivers/common/meta.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
> index 84a2a5f..97d91ac 100644
> --- a/src/mesa/drivers/common/meta.c
> +++ b/src/mesa/drivers/common/meta.c
> @@ -1117,8 +1117,10 @@ blitframebuffer_texture(GLcontext *ctx,
>           _mesa_BindTexture(target, texObj->Name);
>           _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, filter);
>           _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, filter);
> -         _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel);
> -         _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel);
> +         if (target != GL_TEXTURE_RECTANGLE_ARB) {
> +            _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel);
> +            _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel);
> +         }
>           _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
>           _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
>           _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
> @@ -1176,8 +1178,10 @@ blitframebuffer_texture(GLcontext *ctx,
>            */
>           _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);
> +         if (target != GL_TEXTURE_RECTANGLE_ARB) {
> +            _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, baseLevelSave);
> +            _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave);
> +         }
>           _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave);
>           _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave);
>  

srcLevel should be zero if target == GL_TEXTURE_RECTANGLE_ARB, so the 
first call to _mesa_TexParameteri() shouldn't generate an error.  But 
the fix is OK anyway.  The second call would definitely generate an error.

Committed.

-Brian





More information about the mesa-dev mailing list