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

Eirik Byrkjeflot Anonsen eirik at eirikba.org
Tue Jan 10 10:36:14 PST 2012


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?

eirik

> +
> +#define EXPAND_4_8(X)  ( ((X) << 4) | (X) )
> +
> +#define EXPAND_5_8(X)  ( ((X) << 3) | ((X) >> 2) )
> +
> +#define EXPAND_6_8(X)  ( ((X) << 2) | ((X) >> 4) )
> +
[...]


More information about the mesa-dev mailing list