[Mesa-dev] [PATCH 14/23] readpix: use integer conversion for RGBA/UNSIGNED_BYTE

Ian Romanick idr at freedesktop.org
Mon Jan 7 10:55:47 PST 2013


On 01/04/2013 06:41 PM, Jordan Justen wrote:
> 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.

Is there any spec justification for this?  This seems... wrong.

>
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>   src/mesa/main/readpix.c |    5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
> index 5b80e9a..8e99bfb 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);
>



More information about the mesa-dev mailing list