On Sun, 4 Sep 2011 15:05:04 +0100, Dave Airlie <[email protected]> wrote: > From: Dave Airlie <[email protected]> > > This adds the vertex processing paths for the 2101010 types. It converts > the attributes to floats for all the immediate entry points, some entrypoints > are normalised and the attrib APIs take a normalized parameter. > > There are four main paths, > ui10 -> float unnormalized > i10 -> float unnormalized > ui10 -> float normalized > i10 -> float normalized > along with the ui2/i2 equivs. > > Signed-off-by: Dave Airlie <[email protected]> > --- > src/mesa/vbo/vbo_attrib_tmp.h | 401 > ++++++++++++++++++++++++++++++++++++++++- > src/mesa/vbo/vbo_exec_api.c | 45 +++++ > src/mesa/vbo/vbo_save_api.c | 46 +++++ > 3 files changed, 490 insertions(+), 2 deletions(-) > > diff --git a/src/mesa/vbo/vbo_attrib_tmp.h b/src/mesa/vbo/vbo_attrib_tmp.h > index c793ce0..4283154 100644 > --- a/src/mesa/vbo/vbo_attrib_tmp.h > +++ b/src/mesa/vbo/vbo_attrib_tmp.h
> +static inline float conv_ui10_to_norm_float(unsigned ui10)
> +{
> + return (float)(ui10) / 1023.0;
> +}
> +
> +static inline float conv_ui2_to_norm_float(unsigned ui2)
> +{
> + return (float)(ui2) / 3.0;
> +}
> +
> +#define ATTRUI10_1( A, UI ) ATTR( A, 1, (UI) & 0x3ff, 0, 0, 1 )
> +#define ATTRUI10_2( A, UI ) ATTR( A, 2, (UI) & 0x3ff, ((UI) >> 10) & 0x3ff,
> 0, 1 )
> +#define ATTRUI10_3( A, UI ) ATTR( A, 3, (UI) & 0x3ff, ((UI) >> 10) & 0x3ff,
> ((UI) >> 20) & 0x3ff, 1 )
> +#define ATTRUI10_4( A, UI ) ATTR( A, 4, (UI) & 0x3ff, ((UI) >> 10) & 0x3ff,
> ((UI) >> 20) & 0x3ff, ((UI) >> 30) & 0x3 )
> +
> +#define ATTRUI10N_1( A, UI ) ATTR( A, 1, conv_ui10_to_norm_float((UI) &
> 0x3ff), 0, 0, 1 )
> +#define ATTRUI10N_2( A, UI ) ATTR( A, 2, \
> + conv_ui10_to_norm_float((UI) & 0x3ff), \
> + conv_ui10_to_norm_float(((UI) >> 10) &
> 0x3ff), 0, 1 )
> +#define ATTRUI10N_3( A, UI ) ATTR( A, 3, \
> + conv_ui10_to_norm_float((UI) & 0x3ff), \
> + conv_ui10_to_norm_float(((UI) >> 10) &
> 0x3ff), \
> + conv_ui10_to_norm_float(((UI) >> 20) &
> 0x3ff), 1 )
> +#define ATTRUI10N_4( A, UI ) ATTR( A, 4, \
> + conv_ui10_to_norm_float((UI) & 0x3ff), \
> + conv_ui10_to_norm_float(((UI) >> 10) &
> 0x3ff), \
> + conv_ui10_to_norm_float(((UI) >> 20) &
> 0x3ff), \
> + conv_ui2_to_norm_float(((UI) >> 30) & 0x3) )
I think the alpha value for <4-component UNSIGNED_INT types here should
be 0x3 (though it looks right for INT below).
pgpJpslI4vvbz.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
