diff options
author | marha <marha@users.sourceforge.net> | 2012-02-08 16:41:27 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-02-08 16:41:27 +0100 |
commit | 03346747e21e4cd1db30c6a5d8af6705575e3755 (patch) | |
tree | 120604af21bdac64007a0a3005dcce420cb76714 /mesalib/src/mesa/main/teximage.c | |
parent | ada3d2c30b5a7a1a79e128b7326d50c3bab77a8a (diff) | |
download | vcxsrv-03346747e21e4cd1db30c6a5d8af6705575e3755.tar.gz vcxsrv-03346747e21e4cd1db30c6a5d8af6705575e3755.tar.bz2 vcxsrv-03346747e21e4cd1db30c6a5d8af6705575e3755.zip |
mesa git update 8 feb 2012
Diffstat (limited to 'mesalib/src/mesa/main/teximage.c')
-rw-r--r-- | mesalib/src/mesa/main/teximage.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/mesalib/src/mesa/main/teximage.c b/mesalib/src/mesa/main/teximage.c index 018aca063..25da75369 100644 --- a/mesalib/src/mesa/main/teximage.c +++ b/mesalib/src/mesa/main/teximage.c @@ -1511,6 +1511,7 @@ texture_error_check( struct gl_context *ctx, const GLboolean isProxy = target == proxyTarget; GLboolean sizeOK = GL_TRUE; GLboolean colorFormat; + GLenum err; /* Even though there are no color-index textures, we still have to support * uploading color-index data and remapping it to RGB via the @@ -1579,16 +1580,10 @@ texture_error_check( struct gl_context *ctx, } /* Check incoming image format and type */ - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - /* Normally, GL_INVALID_OPERATION is generated by a format/type - * mismatch (see the 1.2 spec page 94, sec 3.6.4.). But with the - * GL_EXT_texture_integer extension, some combinations should generate - * GL_INVALID_ENUM instead (grr!). - */ + err = _mesa_error_check_format_and_type(ctx, format, type); + if (err != GL_NO_ERROR) { if (!isProxy) { - GLenum error = _mesa_is_integer_format(format) - ? GL_INVALID_ENUM : GL_INVALID_OPERATION; - _mesa_error(ctx, error, + _mesa_error(ctx, err, "glTexImage%dD(incompatible format 0x%x, type 0x%x)", dimensions, format, type); } @@ -1737,6 +1732,8 @@ subtexture_error_check( struct gl_context *ctx, GLuint dimensions, GLint width, GLint height, GLint depth, GLenum format, GLenum type ) { + GLenum err; + /* Basic level check */ if (level < 0 || level >= MAX_TEXTURE_LEVELS) { _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage2D(level=%d)", level); @@ -1760,13 +1757,9 @@ subtexture_error_check( struct gl_context *ctx, GLuint dimensions, return GL_TRUE; } - if (!_mesa_is_legal_format_and_type(ctx, format, type)) { - /* As with the glTexImage2D check above, the error code here - * depends on texture integer. - */ - GLenum error = _mesa_is_integer_format(format) - ? GL_INVALID_OPERATION : GL_INVALID_ENUM; - _mesa_error(ctx, error, + err = _mesa_error_check_format_and_type(ctx, format, type); + if (err != GL_NO_ERROR) { + _mesa_error(ctx, err, "glTexSubImage%dD(incompatible format 0x%x, type 0x%x)", dimensions, format, type); return GL_TRUE; |