[Mesa-dev] [PATCH 09/23] copytexture: for GLES make sure integer signed vs. unsigned matches
Ian Romanick
idr at freedesktop.org
Mon Jan 7 10:39:05 PST 2013
On 01/04/2013 06:41 PM, Jordan Justen wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
> src/mesa/main/teximage.c | 21 ++++++++++++++-------
> 1 file changed, 14 insertions(+), 7 deletions(-)
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index d87808d..ac60a21 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -2430,13 +2430,20 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions,
> * integer format and the read color buffer is an integer format."
> */
> if (_mesa_is_color_format(internalFormat)) {
> - struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer;
> -
> - if (_mesa_is_enum_format_integer(rb->InternalFormat) !=
> - _mesa_is_enum_format_integer(internalFormat)) {
> - _mesa_error(ctx, GL_INVALID_OPERATION,
> - "glCopyTexImage%dD(integer vs non-integer)", dimensions);
> - return GL_TRUE;
> + bool is_int = _mesa_is_enum_format_integer(internalFormat);
> + bool is_rbint = _mesa_is_enum_format_integer(rb_internal_format);
Where does rb_internal_format come from? I didn't see it added in an
earlier patch...
> + if (is_int || is_rbint) {
> + if (is_int != is_rbint) {
> + _mesa_error(ctx, GL_INVALID_OPERATION,
> + "glCopyTexImage%dD(integer vs non-integer)", dimensions);
> + return GL_TRUE;
> + } else if (_mesa_is_gles(ctx) &&
> + _mesa_is_enum_format_unsigned_int(internalFormat) !=
> + _mesa_is_enum_format_unsigned_int(rb_internal_format)) {
> + _mesa_error(ctx, GL_INVALID_OPERATION,
> + "glCopyTexImage%dD(signed vs unsigned integer)", dimensions);
> + return GL_TRUE;
> + }
> }
> }
>
>
More information about the mesa-dev
mailing list