[Mesa-dev] [PATCH 2/2] swrast: fix unmatched span->array->ChanType

Brian Paul brianp at vmware.com
Fri Nov 18 08:49:57 PST 2011


On 11/18/2011 12:38 AM, Yuanhan Liu wrote:
> texture_combine converts the result rgba to CHAN_TYPE from FLOAT. At the
> same time, make sure the span->array->ChanType is changed, too.
>
> Signed-off-by: Yuanhan Liu<yuanhan.liu at linux.intel.com>
> ---
>   src/mesa/swrast/s_texcombine.c |    5 +++++
>   1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/src/mesa/swrast/s_texcombine.c b/src/mesa/swrast/s_texcombine.c
> index 0686acd..9f9b7fb 100644
> --- a/src/mesa/swrast/s_texcombine.c
> +++ b/src/mesa/swrast/s_texcombine.c
> @@ -545,6 +545,11 @@ texture_combine( struct gl_context *ctx, GLuint unit,
>         UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][BCOMP], rgba[i][BCOMP]);
>         UNCLAMPED_FLOAT_TO_CHAN(rgbaChan[i][ACOMP], rgba[i][ACOMP]);
>      }
> +   /*
> +    * span->array->rgba is coverted to CHAN type by force, so it's a
> +    * need to make sure the span->array->ChanType is converted, too.
> +    */

Maybe rewrite that comment as:

/* The span->array->rgba values are of CHAN type so set
  * span->array->ChanType field accordingly.
  */

> +   span->array->ChanType = CHAN_TYPE;
>
>   end:
>      for (i = 0; i<  numArgsRGB || i<  numArgsA; i++) {

otherwise,

Reviewed-by: Brian Paul <brianp at vmware.com>


More information about the mesa-dev mailing list