[Mesa-dev] [PATCH 1/9] mesa: re-order, update comments on lighting-related structs

Ian Romanick idr at freedesktop.org
Fri Jun 29 10:10:56 PDT 2012


On 06/26/2012 02:12 PM, Brian Paul wrote:

Patches 1 through 7 are

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>   src/mesa/main/mtypes.h |   50 ++++++++++++++++++++++++------------------------
>   1 files changed, 25 insertions(+), 25 deletions(-)
>
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index f18b81e..8572b5f 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -630,6 +630,26 @@ struct gl_config
>
>
>   /**
> + * Material state.
> + */
> +struct gl_material
> +{
> +   GLfloat Attrib[MAT_ATTRIB_MAX][4];
> +};
> +
> +
> +/**
> + * Light state flags.
> + */
> +/*@{*/
> +#define LIGHT_SPOT         0x1
> +#define LIGHT_LOCAL_VIEWER 0x2
> +#define LIGHT_POSITIONAL   0x4
> +#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
> +/*@}*/
> +
> +
> +/**
>    * Light source state.
>    */
>   struct gl_light
> @@ -654,7 +674,7 @@ struct gl_light
>       * \name Derived fields
>       */
>      /*@{*/
> -   GLbitfield _Flags;		/**<  State */
> +   GLbitfield _Flags;		/**<  Mask of LIGHT_x bits defined above */
>
>      GLfloat _Position[4];	/**<  position in eye/obj coordinates */
>      GLfloat _VP_inf_norm[3];	/**<  Norm direction to infinite light */
> @@ -683,15 +703,6 @@ struct gl_lightmodel
>
>
>   /**
> - * Material state.
> - */
> -struct gl_material
> -{
> -   GLfloat Attrib[MAT_ATTRIB_MAX][4];
> -};
> -
> -
> -/**
>    * Accumulation buffer attribute group (GL_ACCUM_BUFFER_BIT)
>    */
>   struct gl_accum_attrib
> @@ -912,16 +923,6 @@ struct gl_hint_attrib
>      GLenum FragmentShaderDerivative; /**<  GL_ARB_fragment_shader */
>   };
>
> -/**
> - * Light state flags.
> - */
> -/*@{*/
> -#define LIGHT_SPOT         0x1
> -#define LIGHT_LOCAL_VIEWER 0x2
> -#define LIGHT_POSITIONAL   0x4
> -#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
> -/*@}*/
> -
>
>   /**
>    * Lighting attribute group (GL_LIGHT_BIT).
> @@ -932,11 +933,10 @@ struct gl_light_attrib
>      struct gl_lightmodel Model;		/**<  Lighting model */
>
>      /**
> -    * Must flush FLUSH_VERTICES before referencing:
> +    * Front and back material values.
> +    * Note: must call FLUSH_VERTICES() before using.
>       */
> -   /*@{*/
> -   struct gl_material Material; 	/**<  Includes front&  back values */
> -   /*@}*/
> +   struct gl_material Material;
>
>      GLboolean Enabled;			/**<  Lighting enabled flag */
>      GLenum ShadeModel;			/**<  GL_FLAT or GL_SMOOTH */
> @@ -945,7 +945,7 @@ struct gl_light_attrib
>      GLenum ColorMaterialMode;		/**<  GL_AMBIENT, GL_DIFFUSE, etc */
>      GLbitfield ColorMaterialBitmask;	/**<  bitmask formed from Face and Mode */
>      GLboolean ColorMaterialEnabled;
> -   GLenum ClampVertexColor;
> +   GLenum ClampVertexColor;             /**<  GL_TRUE, GL_FALSE, GL_FIXED_ONLY */
>      GLboolean _ClampVertexColor;
>
>      struct gl_light EnabledList;         /**<  List sentinel */



More information about the mesa-dev mailing list