glsl: Handle continuation characters in preprocessor.
[mesa.git] / src / mesa / swrast / s_tritemp.h
index 2a90ffd85f80a9f5f91c50d07c1eb12bf8d4e7a4..8e3c5b5eebb189d9cedf353ae0ff0628bb905251 100644 (file)
@@ -144,7 +144,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
 
    (void) swrast;
 
-   INIT_SPAN(span, GL_POLYGON, 0, 0, 0);
+   INIT_SPAN(span, GL_POLYGON);
    span.y = 0; /* silence warnings */
 
 #ifdef INTERP_Z
@@ -234,18 +234,18 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
    /* compute area, oneOverArea and perform backface culling */
    {
       const GLfloat area = eMaj.dx * eBot.dy - eBot.dx * eMaj.dy;
-      /* Do backface culling */
-      if (area * bf < 0.0)
-         return;
 
       if (IS_INF_OR_NAN(area) || area == 0.0F)
          return;
 
-      oneOverArea = 1.0F / area;
-   }
+      if (area * bf * swrast->_BackfaceCullSign < 0.0)
+         return;
 
+      oneOverArea = 1.0F / area;
 
-   span.facing = ctx->_Facing; /* for 2-sided stencil test */
+      /* 0 = front, 1 = back */
+      span.facing = oneOverArea * bf > 0.0F;
+   }
 
    /* Edge setup.  For a triangle strip these could be reused... */
    {
@@ -393,7 +393,7 @@ static void NAME(GLcontext *ctx, const SWvertex *v0,
         span.greenStep = 0;
         span.blueStep  = 0;
 #  ifdef INTERP_ALPHA
-         span.attrStepX[FRAG_ATTRIB_COL0][3] = span.attrStepX[FRAG_ATTRIB_COL0][3] = 0.0F;
+         span.attrStepX[FRAG_ATTRIB_COL0][3] = span.attrStepY[FRAG_ATTRIB_COL0][3] = 0.0F;
         span.alphaStep = 0;
 #  endif
       }