summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/readpix.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-02-07 07:42:33 -0700
committerBrian Paul <[email protected]>2012-02-07 07:45:38 -0700
commitb8f7eef4ef84d53d32d08a70dc7daec623cf7eab (patch)
tree4647da084115ebe1217858893f496f8fecd2787c /src/mesa/main/readpix.c
parent6bed7a861da05ef9751b373a78490db1c5b3e277 (diff)
mesa: stop using _mesa_error_check_format_type() in glReadPixels
Basically the same story as the previous commit. But we were already calling _mesa_source_buffer_exists() in ReadPixels(). Yeah, we were calling it twice. Signed-off-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/readpix.c')
-rw-r--r--src/mesa/main/readpix.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index b753e40be27..9b9663af5ac 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -697,6 +697,8 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
GLenum format, GLenum type, GLsizei bufSize,
GLvoid *pixels )
{
+ GLenum err;
+
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
@@ -718,8 +720,11 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
if (ctx->NewState)
_mesa_update_state(ctx);
- if (_mesa_error_check_format_type(ctx, format, type, GL_FALSE)) {
- /* found an error */
+ err = _mesa_error_check_format_and_type(ctx, format, type);
+ if (err != GL_NO_ERROR) {
+ _mesa_error(ctx, err, "glReadPixels(invalid format %s and/or type %s)",
+ _mesa_lookup_enum_by_nr(format),
+ _mesa_lookup_enum_by_nr(type));
return;
}