r300: Further reduced the radeon_span.c diff.
[mesa.git] / src / mesa / swrast / s_feedback.c
index 26cb05cd5603d46597dc74ddfe41ad9376891492..5d3fbdfeb6e1c415a569ef11ce1cd2ea8eec1bdd 100644 (file)
 static void feedback_vertex( GLcontext *ctx,
                              const SWvertex *v, const SWvertex *pv )
 {
-   const GLuint texUnit = 0;  /* See section 5.3 of 1.2.1 spec */
    GLfloat win[4];
    GLfloat color[4];
    GLfloat tc[4];
+   const GLfloat *vtc = v->attrib[FRAG_ATTRIB_TEX0];
 
    win[0] = v->win[0];
    win[1] = v->win[1];
@@ -61,16 +61,15 @@ static void feedback_vertex( GLcontext *ctx,
    color[2] = CHAN_TO_FLOAT(pv->color[2]);
    color[3] = CHAN_TO_FLOAT(pv->color[3]);
 
-   if (v->texcoord[texUnit][3] != 1.0 &&
-       v->texcoord[texUnit][3] != 0.0) {
-      GLfloat invq = 1.0F / v->texcoord[texUnit][3];
-      tc[0] = v->texcoord[texUnit][0] * invq;
-      tc[1] = v->texcoord[texUnit][1] * invq;
-      tc[2] = v->texcoord[texUnit][2] * invq;
-      tc[3] = v->texcoord[texUnit][3];
+   if (vtc[3] != 1.0 && vtc[3] != 0.0) {
+      GLfloat invq = 1.0F / vtc[3];
+      tc[0] = vtc[0] * invq;
+      tc[1] = vtc[1] * invq;
+      tc[2] = vtc[2] * invq;
+      tc[3] = vtc[3];
    }
    else {
-      COPY_4V(tc, v->texcoord[texUnit]);
+      COPY_4V(tc, vtc);
    }
 
    _mesa_feedback_vertex( ctx, win, color, (GLfloat) v->index, tc );