swrast: fix unmatched span->array->ChanType
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Mon, 21 Nov 2011 08:31:58 +0000 (16:31 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Mon, 21 Nov 2011 08:32:39 +0000 (16:32 +0800)
texture_combine converts the result rgba to CHAN_TYPE from FLOAT. At the
same time, make sure the span->array->ChanType is changed, too.

v2: pick a nicer comment from Brian

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/swrast/s_texcombine.c

index 0686acd116980aac8a3d2201f1cacd532b62921d..1fce5c56562e24b0792fcc4e79841f275a6d5e46 100644 (file)
@@ -545,6 +545,10 @@ 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]);
    }
+   /* 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++) {