[Mesa-dev] [PATCH 3/4] mesa/vbo: add ARB_vertex_type_2_10_10_10_rev APIs.

Dave Airlie airlied at gmail.com
Mon Sep 5 12:44:03 PDT 2011


>> +
>> +#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).

The alpha value ends up in the alpha component as a float, it doesn't
get converted from UI so I think 1 is fine.

Dave.


More information about the mesa-dev mailing list