[Mesa-dev] [PATCH 1/2] mesa: Add GL_UNSIGNED_BYTE fast-path to fast_read_rgba_pixels_memcpy

Michel Dänzer michel at daenzer.net
Mon Mar 11 03:54:14 PDT 2013


On Son, 2013-03-10 at 23:05 +0100, Martin Andersson wrote: 
> ---
>  src/mesa/main/readpix.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
> index 2f130ae..349b0bc 100644
> --- a/src/mesa/main/readpix.c
> +++ b/src/mesa/main/readpix.c
> @@ -238,7 +238,7 @@ fast_read_rgba_pixels_memcpy( struct gl_context *ctx,
>     }
>     else if (rb->Format == MESA_FORMAT_XRGB8888 &&
>         format == GL_BGRA &&
> -       type == GL_UNSIGNED_INT_8_8_8_8_REV &&
> +       (type == GL_UNSIGNED_INT_8_8_8_8_REV || type == GL_UNSIGNED_BYTE) &&

This cannot be equivalent on little endian and big endian hosts at the
same time. As it works for you, it's apparently equivalent on little
endian.


I suspect ReadPixels could be made even faster with similar treatment as
Marek has applied to TexSubImage etc.


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the mesa-dev mailing list