fix typo
[mesa.git] / src / mesa / swrast / s_span.c
index 59e89252a051d490c62640c23d0e7df8fdbaaecf..ee46f323076e64964e54b481ce5e4db10be95472 100644 (file)
@@ -110,7 +110,7 @@ _swrast_span_default_color( GLcontext *ctx, struct sw_span *span )
       span->interpMask |= SPAN_RGBA;
    }
    else {
-      span->index = IntToFixed(ctx->Current.RasterIndex);
+      span->index = FloatToFixed(ctx->Current.RasterIndex);
       span->indexStep = 0;
       span->interpMask |= SPAN_INDEX;
    }
@@ -361,7 +361,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
             GLfloat texW, texH;
             GLboolean needLambda;
             if (obj) {
-               const struct gl_texture_image *img = obj->Image[obj->BaseLevel];
+               const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
                needLambda = (obj->MinFilter != obj->MagFilter)
                   || ctx->FragmentProgram.Enabled;
                texW = img->WidthScale;
@@ -453,7 +453,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
       GLfloat texW, texH;
       GLboolean needLambda;
       if (obj) {
-         const struct gl_texture_image *img = obj->Image[obj->BaseLevel];
+         const struct gl_texture_image *img = obj->Image[0][obj->BaseLevel];
          needLambda = (obj->MinFilter != obj->MagFilter)
             || ctx->FragmentProgram.Enabled;
          texW = (GLfloat) img->WidthScale;
@@ -515,6 +515,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
                texcoord[i][0] = s * invQ;
                texcoord[i][1] = t * invQ;
                texcoord[i][2] = r * invQ;
+               texcoord[i][3] = q;
                s += dsdx;
                t += dtdx;
                r += drdx;
@@ -526,6 +527,7 @@ interpolate_texcoords(GLcontext *ctx, struct sw_span *span)
                texcoord[i][0] = s * invQ;
                texcoord[i][1] = t * invQ;
                texcoord[i][2] = r * invQ;
+               texcoord[i][3] = q;
                s += dsdx;
                t += dtdx;
                r += drdx;
@@ -714,7 +716,7 @@ multi_write_rgba_span( GLcontext *ctx, struct sw_span *span )
          /* make copy of incoming colors */
          MEMCPY( rgbaTmp, span->array->rgba, 4 * span->end * sizeof(GLchan) );
 
-         if (ctx->Color.ColorLogicOpEnabled) {
+         if (ctx->Color._LogicOpEnabled) {
             _swrast_logicop_rgba_span(ctx, span, rgbaTmp);
          }
          else if (ctx->Color.BlendEnabled) {
@@ -1098,7 +1100,7 @@ _swrast_write_rgba_span( GLcontext *ctx, struct sw_span *span)
    }
    else {
       /* normal: write to exactly one buffer */
-      if (ctx->Color.ColorLogicOpEnabled) {
+      if (ctx->Color._LogicOpEnabled) {
          _swrast_logicop_rgba_span(ctx, span, span->array->rgba);
          monoColor = GL_FALSE;
       }
@@ -1205,7 +1207,7 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *span)
          span->primitive == GL_POLYGON  ||  span->primitive == GL_BITMAP);
    ASSERT(span->end <= MAX_WIDTH);
    ASSERT((span->interpMask & span->arrayMask) == 0);
-   ASSERT(ctx->Texture._EnabledCoordUnits);
+   ASSERT(ctx->Texture._EnabledCoordUnits || ctx->FragmentProgram.Enabled);
 
    /*
    printf("%s()  interp 0x%x  array 0x%x\n", __FUNCTION__, span->interpMask, span->arrayMask);
@@ -1371,7 +1373,7 @@ _swrast_write_texture_span( GLcontext *ctx, struct sw_span *span)
    }
    else {
       /* normal: write to exactly one buffer */
-      if (ctx->Color.ColorLogicOpEnabled) {
+      if (ctx->Color._LogicOpEnabled) {
          _swrast_logicop_rgba_span(ctx, span, span->array->rgba);
       }
       else if (ctx->Color.BlendEnabled) {