diff options
author | marha <marha@users.sourceforge.net> | 2011-11-10 09:37:16 +0100 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-11-10 09:37:16 +0100 |
commit | 7381bc7b9f63b2a6bf9ea9cbe04614adfc4b2369 (patch) | |
tree | 77cb2af2337d035d6d0b6acb57379b62cfd2c648 /mesalib/src/mesa/swrast/s_readpix.c | |
parent | 5e98834988b1f5ab74ef6561e493615d55f8c10c (diff) | |
parent | ba1993a2eefbd475b13f373a861a401f06584cf8 (diff) | |
download | vcxsrv-7381bc7b9f63b2a6bf9ea9cbe04614adfc4b2369.tar.gz vcxsrv-7381bc7b9f63b2a6bf9ea9cbe04614adfc4b2369.tar.bz2 vcxsrv-7381bc7b9f63b2a6bf9ea9cbe04614adfc4b2369.zip |
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/swrast/s_readpix.c')
-rw-r--r-- | mesalib/src/mesa/swrast/s_readpix.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/mesalib/src/mesa/swrast/s_readpix.c b/mesalib/src/mesa/swrast/s_readpix.c index 4438b9a20..b5618e884 100644 --- a/mesalib/src/mesa/swrast/s_readpix.c +++ b/mesalib/src/mesa/swrast/s_readpix.c @@ -236,7 +236,10 @@ slow_read_rgba_pixels( struct gl_context *ctx, GLbitfield transferOps ) { struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; - GLfloat rgba[MAX_WIDTH][4]; + union { + float f[MAX_WIDTH][4]; + unsigned int i[MAX_WIDTH][4]; + } rgba; GLubyte *dst, *map; int dstStride, stride, j; @@ -248,11 +251,15 @@ slow_read_rgba_pixels( struct gl_context *ctx, &map, &stride); for (j = 0; j < height; j++) { - _mesa_unpack_rgba_row(_mesa_get_srgb_format_linear(rb->Format), - width, map, rgba); - _mesa_pack_rgba_span_float(ctx, width, rgba, format, type, dst, - packing, transferOps); - + if (_mesa_is_integer_format(format)) { + _mesa_unpack_int_rgba_row(rb->Format, width, map, rgba.i); + _mesa_pack_rgba_span_int(ctx, width, rgba.i, format, type, dst); + } else { + _mesa_unpack_rgba_row(_mesa_get_srgb_format_linear(rb->Format), + width, map, rgba.f); + _mesa_pack_rgba_span_float(ctx, width, rgba.f, format, type, dst, + packing, transferOps); + } dst += dstStride; map += stride; } |