diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2013-01-04 12:29:02 -0800 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2013-01-04 17:26:01 -0800 |
commit | 0faa38ccc6671a50428b23814f87cf87769926b2 (patch) | |
tree | 473e1641d54d6f371c938dddf519585cfb6cbcaf | |
parent | ed9f60807027c85970e71c75878fe15594814a32 (diff) |
readpix: for implentation format/type, ignore int vs. non-int check
In ES or GL+GL_ARB_ES2_compatibility, the usage of
format = IMPLEMENTATION_COLOR_READ_FORMAT +
type = IMPLEMENTATION_COLOR_READ_TYPE
can function, even if the src/dst int vs. non-int types
differ.
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
-rw-r--r-- | src/mesa/main/readpix.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c index f21242c7219..24120e7bf55 100644 --- a/src/mesa/main/readpix.c +++ b/src/mesa/main/readpix.c @@ -817,17 +817,25 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height, return; } - /* Check that the destination format and source buffer are both - * integer-valued or both non-integer-valued. - */ if (ctx->Extensions.EXT_texture_integer && _mesa_is_color_format(format)) { - const struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; - const GLboolean srcInteger = _mesa_is_format_integer_color(rb->Format); - const GLboolean dstInteger = _mesa_is_enum_format_integer(format); - if (dstInteger != srcInteger) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glReadPixels(integer / non-integer format mismatch"); - return; + if (_mesa_get_color_read_format(ctx) == format && + _mesa_get_color_read_type(ctx) == type) { + /* IMPLEMENTATION_COLOR_READ_FORMAT and + * IMPLEMENTATION_COLOR_READ_TYPE are being used. Therefore + * we don't need to check integer vs. non-integer below. + */ + } else { + /* Check that the destination format and source buffer are both + * integer-valued or both non-integer-valued. + */ + const struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; + const GLboolean srcInteger = _mesa_is_format_integer_color(rb->Format); + const GLboolean dstInteger = _mesa_is_enum_format_integer(format); + if (dstInteger != srcInteger) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glReadPixels(integer / non-integer format mismatch"); + return; + } } } |