[Mesa-dev] [PATCH 2/3] mesa: Introduce enabled bitfield helper functions.

Eric Anholt eric at anholt.net
Fri Dec 30 12:10:18 PST 2011


On Thu, 29 Dec 2011 23:13:57 +0100, Mathias Froehlich <Mathias.Froehlich at gmx.net> wrote:
> +/** Returns the bitmask of all enabled arrays in fixed function mode.
> + *
> + *  In fixed function mode only the traditional fixed function arrays
> + *  are available.
> + */
> +static inline GLbitfield64
> +_mesa_array_object_get_enabled_ff(const struct gl_array_object *arrayObj)
> +{
> +   return arrayObj->_Enabled & VERT_BIT_FF_ALL;
> +}
> +
> +/** Returns the bitmask of all enabled arrays in nv shader mode.
> + *
> + *  In nv shader mode any the generic nv arrays superseed the traditional
> + *  fixed function arrays. The nv generic arrays take precedence
> + *  over the legacy arrays.
> + */

Looks like the description is stated twice here.  I'd just say "In NV
shader mode, The nv generic arrays take precedence over the legacy
arrays."

> +/** Returns the bitmask of all enabled arrays in arb/glsl shader mode.
> + *
> + *  In arb/glsl shader mode all the fixed function and the arg/glsl generic

s/arg/arb/

> + *  arrays are available. Here only the first generic array takes
> + *  precedence over the legacy position array.
> + */
> +static inline GLbitfield64
> +_mesa_array_object_get_enabled_arb(const struct gl_array_object *arrayObj)
> +{
> +   GLbitfield64 enabled = arrayObj->_Enabled;
> +   return enabled & ~(VERT_BIT_POS & (enabled >> VERT_ATTRIB_GENERIC0));
> +}

> +#define VERT_BIT_FF_NVALIAS      \
> +   BITFIELD64_RANGE(VERT_ATTRIB_POS, VERT_ATTRIB_GENERIC_NV_MAX)

I had to read this one like 3 times to follow it.  This range is
GENERIC0 to GENERIC_MAX shifted down to start from POS.  I think I'd
prefer to see VERT_ATTRIB_TEX(VERT_ATTRIB_TEX_MAX) used to make it more
obvious what is aliased, and slightly future-proof for when
VERT_ATTRIB_GENERIC_MAX is increased.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111230/d253bfae/attachment.pgp>


More information about the mesa-dev mailing list