Merge commit 'origin/master' into i965g-restart
[mesa.git] / src / mesa / swrast_setup / ss_tritmp.h
index 97d2f4a16b19d60604de2bc4d5b7294c301d4692..17f38639563fc484d61933a701ce839a74f4899b 100644 (file)
@@ -67,8 +67,8 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
         if (facing == 1) {
            if (IND & SS_TWOSIDE_BIT) {
               if (IND & SS_RGBA_BIT) {
-                  if (VB->ColorPtr[1]) {
-                     GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data;
+                  if (VB->BackfaceColorPtr) {
+                     GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data;
 
                      if (swsetup->intColors) {
                         COPY_CHAN4(saved_color[0], v[0]->color);
@@ -81,7 +81,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
                         COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL0]);
                      }
 
-                     if (VB->ColorPtr[1]->stride) {
+                     if (VB->BackfaceColorPtr->stride) {
                         if (swsetup->intColors) {
                            SS_COLOR(v[0]->color, vbcolor[e0]);
                            SS_COLOR(v[1]->color, vbcolor[e1]);
@@ -108,14 +108,14 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
                      }
                   }
 
-                 if (VB->SecondaryColorPtr[1]) {
-                    GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data;
+                 if (VB->BackfaceSecondaryColorPtr) {
+                    GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data;
 
                     COPY_4V(saved_spec[0], v[0]->attrib[FRAG_ATTRIB_COL1]);
                     COPY_4V(saved_spec[1], v[1]->attrib[FRAG_ATTRIB_COL1]);
                     COPY_4V(saved_spec[2], v[2]->attrib[FRAG_ATTRIB_COL1]);
 
-                    if (VB->SecondaryColorPtr[1]->stride) {
+                    if (VB->BackfaceSecondaryColorPtr->stride) {
                        SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[e0]);
                        SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]);
                        SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[e2]);
@@ -127,7 +127,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
                     }
                  }
               } else {
-                 GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data;
+                 GLfloat *vbindex = (GLfloat *)VB->BackfaceIndexPtr->data;
                  saved_index[0] = v[0]->attrib[FRAG_ATTRIB_CI][0];
                  saved_index[1] = v[1]->attrib[FRAG_ATTRIB_CI][0];
                  saved_index[2] = v[2]->attrib[FRAG_ATTRIB_CI][0];
@@ -171,14 +171,14 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
         v[1]->attrib[FRAG_ATTRIB_WPOS][2] = oz1;
         v[2]->attrib[FRAG_ATTRIB_WPOS][2] = oz2;
       }
-      _swsetup_render_point_tri( ctx, e0, e1, e2, facing );
+      _swsetup_render_tri(ctx, e0, e1, e2, facing, _swsetup_edge_render_point_tri);
    } else if (mode == GL_LINE) {
       if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetLine) {
         v[0]->attrib[FRAG_ATTRIB_WPOS][2] = oz0;
         v[1]->attrib[FRAG_ATTRIB_WPOS][2] = oz1;
         v[2]->attrib[FRAG_ATTRIB_WPOS][2] = oz2;
       }
-      _swsetup_render_line_tri( ctx, e0, e1, e2, facing );
+      _swsetup_render_tri(ctx, e0, e1, e2, facing, _swsetup_edge_render_line_tri);
    } else {
       if ((IND & SS_OFFSET_BIT) && ctx->Polygon.OffsetFill) {
         v[0]->attrib[FRAG_ATTRIB_WPOS][2] = oz0;
@@ -200,7 +200,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
    if (IND & SS_TWOSIDE_BIT) {
       if (facing == 1) {
         if (IND & SS_RGBA_BIT) {
-            if (VB->ColorPtr[1]) {
+            if (VB->BackfaceColorPtr) {
                if (swsetup->intColors) {
                   COPY_CHAN4(v[0]->color, saved_color[0]);
                   COPY_CHAN4(v[1]->color, saved_color[1]);
@@ -213,7 +213,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 )
                }
             }
 
-           if (VB->SecondaryColorPtr[1]) {
+           if (VB->BackfaceSecondaryColorPtr) {
               COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL1], saved_spec[0]);
               COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]);
               COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]);