[Mesa-dev] [PATCH] mesa: add missing texture integer test in glTexSubImage()

Yuanhan Liu yuanhan.liu at linux.intel.com
Wed Feb 15 17:32:00 PST 2012


On Wed, Feb 15, 2012 at 03:41:01PM -0700, Brian Paul wrote:
> If the texture format is integer, the incoming user data must also be
> integer (and similarly for non-integer textures).
> 
> NOTE: This is a candidate for the stable branches.
> ---
>  src/mesa/main/teximage.c |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)
> 
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index e4eb7f6..a3ffb01 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -1852,6 +1852,17 @@ subtexture_error_check2( struct gl_context *ctx, GLuint dimensions,
>        }         
>     }
>  
> +   if (ctx->VersionMajor >= 3 || ctx->Extensions.EXT_texture_integer) {
> +      /* both source and dest must be integer-valued, or neither */
> +      if (_mesa_is_format_integer_color(destTex->TexFormat) !=
> +          _mesa_is_integer_format(format)) {
> +         _mesa_error(ctx, GL_INVALID_OPERATION,
> +                     "glTexSubImage%d(integer/non-integer format mismatch)",
                                        ^
I guess you missed one 'D' here. Other than that,

Reviewed-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>

> +                     dimensions);
> +         return GL_TRUE;
> +      }
> +   }
> +
>     return GL_FALSE;
>  }
>  
> -- 
> 1.7.3.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list