[Mesa-dev] [PATCH 2/3] mesa: add _mesa_unpack_ubyte_rgba_row() function

Brian Paul brianp at vmware.com
Tue Jan 10 11:36:33 PST 2012


On 01/10/2012 11:36 AM, Eirik Byrkjeflot Anonsen wrote:
> Brian Paul<brianp at vmware.com>  writes:
>
>> ---
>>   src/mesa/main/format_unpack.c |  499 +++++++++++++++++++++++++++++++++++++++++
>>   src/mesa/main/format_unpack.h |    3 +
>>   2 files changed, 502 insertions(+), 0 deletions(-)
>>
>> diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c
>> index c723e89..a7308a1 100644
>> --- a/src/mesa/main/format_unpack.c
>> +++ b/src/mesa/main/format_unpack.c
>> @@ -29,6 +29,22 @@
>>   #include "../../gallium/auxiliary/util/u_format_r11g11b10f.h"
>>
>>
>> +
>> +/* Expand 1, 2, 3, 4, 5, 6-bit values to fill 8 bits */
>> +
>> +#define EXPAND_1_8(X)  ( (X) ? 0xff : 0x0 )
>> +
>> +#define EXPAND_2_8(X)  ( ((X)<<  6) | ((X)<<  4) | ((X)<<  2) | (X) )
>> +
>> +#define EXPAND_3_8(X)  ( ((X)<<  5) | ((X)<<  2) | ((X)>  1) )
>
> I assume you meant ((X)>>  1) rather than ((X)>  1) here?
>

Yes, thanks.  I'll fix that.

-Brian



More information about the mesa-dev mailing list