aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2012-12-28 11:16:15 -0800
committerJordan Justen <[email protected]>2013-01-04 17:26:01 -0800
commitadd9b77cbde360412a6bc8dd79b7b6e71549c4dc (patch)
treef07f32bee01de9022cccbbc089b3fb51ef4481cd
parent64e0be7d0bedb456e6ab2f3113b90dbdaa33fe5d (diff)
readpix: use integer conversion for RGBA/UNSIGNED_BYTE
If the source read buffer is integer based, and the the read pixels type is RGBA/UNSIGNED_BYTE, then use the integer pixel conversion path. Signed-off-by: Jordan Justen <[email protected]>
-rw-r--r--src/mesa/main/readpix.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 5b80e9a8ba1..8e99bfb014e 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -325,6 +325,11 @@ slow_read_rgba_pixels( struct gl_context *ctx,
GLboolean dst_is_integer = _mesa_is_enum_format_integer(format);
GLboolean dst_is_uint = _mesa_is_format_unsigned(rbFormat);
+ if (_mesa_is_format_integer_color(rbFormat) && format == GL_RGBA && type == GL_UNSIGNED_BYTE) {
+ format = GL_RGBA_INTEGER;
+ dst_is_integer = GL_TRUE;
+ }
+
dstStride = _mesa_image_row_stride(packing, width, format, type);
dst = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
format, type, 0, 0);