summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/readpix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/readpix.c')
-rw-r--r--src/mesa/main/readpix.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 908a55e702e..6c64cbeb8c4 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -588,6 +588,7 @@ _mesa_error_check_format_type(struct gl_context *ctx, GLenum format,
{
const char *readDraw = drawing ? "Draw" : "Read";
const GLboolean reading = !drawing;
+ GLenum err;
/* state validation should have already been done */
ASSERT(ctx->NewState == 0x0);
@@ -609,9 +610,9 @@ _mesa_error_check_format_type(struct gl_context *ctx, GLenum format,
}
/* basic combinations test */
- if (!_mesa_is_legal_format_and_type(ctx, format, type)) {
- _mesa_error(ctx, GL_INVALID_ENUM,
- "gl%sPixels(format or type)", readDraw);
+ err = _mesa_error_check_format_and_type(ctx, format, type);
+ if (err != GL_NO_ERROR) {
+ _mesa_error(ctx, err, "gl%sPixels(format or type)", readDraw);
return GL_TRUE;
}
@@ -715,7 +716,7 @@ _mesa_error_check_format_type(struct gl_context *ctx, GLenum format,
}
break;
default:
- /* this should have been caught in _mesa_is_legal_format_type() */
+ /* this should have been caught in _mesa_error_check_format_type() */
_mesa_problem(ctx, "unexpected format in _mesa_%sPixels", readDraw);
return GL_TRUE;
}