diff options
author | marha <marha@users.sourceforge.net> | 2013-01-16 08:45:43 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-01-16 08:45:43 +0100 |
commit | b8219a4680768e14b7fe4930adf86e9be261b31f (patch) | |
tree | 193855ef8d48765d67cc11153a15e3c1e2568e50 /mesalib/src/mesa/main/readpix.c | |
parent | 15cdb95b194cb051a5d469cc9eb73eb0eed4db41 (diff) | |
parent | 811d1bcf6d61ea49551abdd7f2294c5af2776913 (diff) | |
download | vcxsrv-b8219a4680768e14b7fe4930adf86e9be261b31f.tar.gz vcxsrv-b8219a4680768e14b7fe4930adf86e9be261b31f.tar.bz2 vcxsrv-b8219a4680768e14b7fe4930adf86e9be261b31f.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
Switched to xcalc-1.0.5
Switched to bdftopcf-1.0.4
libxtrans fontconfig glproto libX11 libXau libXext libXft libXinerama libXmu libfontenc mesa xkeyboard-config
Diffstat (limited to 'mesalib/src/mesa/main/readpix.c')
-rw-r--r-- | mesalib/src/mesa/main/readpix.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/mesalib/src/mesa/main/readpix.c b/mesalib/src/mesa/main/readpix.c index d6d105bc4..5b80e9a8b 100644 --- a/mesalib/src/mesa/main/readpix.c +++ b/mesalib/src/mesa/main/readpix.c @@ -679,7 +679,7 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid *pixels ) { - GLenum err; + GLenum err = GL_NO_ERROR; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -707,17 +707,21 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height, * preferred combination. This code doesn't know what that preferred * combination is, and Mesa can handle anything valid. Just work instead. */ - if (_mesa_is_gles(ctx) && ctx->Version < 30) { - err = _mesa_es_error_check_format_and_type(format, type, 2); - if (err == GL_NO_ERROR) { - if (type == GL_FLOAT || type == GL_HALF_FLOAT_OES) { - err = GL_INVALID_OPERATION; - } else if (format == GL_DEPTH_COMPONENT - || format == GL_DEPTH_STENCIL) { - err = GL_INVALID_ENUM; + if (_mesa_is_gles(ctx)) { + if (ctx->Version < 30) { + err = _mesa_es_error_check_format_and_type(format, type, 2); + if (err == GL_NO_ERROR) { + if (type == GL_FLOAT || type == GL_HALF_FLOAT_OES) { + err = GL_INVALID_OPERATION; + } } } + if (err == GL_NO_ERROR && (format == GL_DEPTH_COMPONENT + || format == GL_DEPTH_STENCIL)) { + err = GL_INVALID_ENUM; + } + if (err != GL_NO_ERROR) { _mesa_error(ctx, err, "glReadPixels(invalid format %s and/or type %s)", _mesa_lookup_enum_by_nr(format), |