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

Martin Andersson g02maran at gmail.com
Mon Mar 11 05:45:50 PDT 2013


On Mon, Mar 11, 2013 at 11:54 AM, Michel Dänzer <michel at daenzer.net> wrote:
> 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.

ok, I guess it is also undesirable to have lots of special cases there, with
checks for lots of different combos of types and endianness.

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

I have looked at TexSubImage and how the radeon dri and intel dri drivers
implement glReadPixels (they use a blit call). But I did not understand
how I could use it for glReadPixels. I will look at it some more, thanks.

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


More information about the mesa-dev mailing list