[Mesa-dev] [PATCH 7/8] util: Expand the comment above the channel[] array

Michel Dänzer michel at daenzer.net
Wed Jun 12 08:07:11 PDT 2013


On Die, 2013-06-11 at 16:26 +0100, Richard Sandiford wrote:
> Signed-off-by: Richard Sandiford <rsandifo at linux.vnet.ibm.com>
> ---
>  src/gallium/auxiliary/util/u_format.h | 42 ++++++++++++++++++++++++++++++++++-
>  1 file changed, 41 insertions(+), 1 deletion(-)
> 
> diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h
> index e4b9c36..db6c290 100644
> --- a/src/gallium/auxiliary/util/u_format.h
> +++ b/src/gallium/auxiliary/util/u_format.h
> @@ -178,9 +178,49 @@ struct util_format_description
>     unsigned is_mixed:1;
>  
>     /**
> -    * Input channel description.
> +    * Input channel description, in the order XYZW.
>      *
>      * Only valid for UTIL_FORMAT_LAYOUT_PLAIN formats.
> +    *
> +    * The general rule is that the order and layout of the channels is the
> +    * same as they would be in a C struct:
> +    *
> +    * struct {
> +    *    ...X...;
> +    *    ...Y...;
> +    *    ...Z...;
> +    *    ...W...;
> +    * };
> +    *
> +    * with bitfields being used for all integer channels.

I'd advise against using the term 'bitfield', as the semantics of C
bitfields are mostly up to the specific C implementation, and it will
lure people into implicitly thinking of the semantics of bitfields in
the C implementation they're using.


-- 
Earthling Michel Dänzer           |                   http://www.amd.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the mesa-dev mailing list