- GLfloat ds, dt, dr, dq;
- span.tex[0][0] = invw0 * vert0->texcoord[0][0];
- span.tex[0][1] = invw0 * vert0->texcoord[0][1];
- span.tex[0][2] = invw0 * vert0->texcoord[0][2];
- span.tex[0][3] = invw0 * vert0->texcoord[0][3];
- ds = (invw1 * vert1->texcoord[0][0]) - span.tex[0][0];
- dt = (invw1 * vert1->texcoord[0][1]) - span.tex[0][1];
- dr = (invw1 * vert1->texcoord[0][2]) - span.tex[0][2];
- dq = (invw1 * vert1->texcoord[0][3]) - span.tex[0][3];
- span.texStepX[0][0] = ds * invLen;
- span.texStepX[0][1] = dt * invLen;
- span.texStepX[0][2] = dr * invLen;
- span.texStepX[0][3] = dq * invLen;
- span.texStepY[0][0] = 0.0F;
- span.texStepY[0][1] = 0.0F;
- span.texStepY[0][2] = 0.0F;
- span.texStepY[0][3] = 0.0F;
- }
-#endif
-#ifdef INTERP_MULTITEX
- interpFlags |= SPAN_TEXTURE;
- {
- const GLfloat invLen = 1.0F / numPixels;
- GLuint u;
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
- if (ctx->Texture.Unit[u]._ReallyEnabled) {
- const GLfloat invw0 = vert0->win[3];
- const GLfloat invw1 = vert1->win[3];
- GLfloat ds, dt, dr, dq;
- span.tex[u][0] = invw0 * vert0->texcoord[u][0];
- span.tex[u][1] = invw0 * vert0->texcoord[u][1];
- span.tex[u][2] = invw0 * vert0->texcoord[u][2];
- span.tex[u][3] = invw0 * vert0->texcoord[u][3];
- ds = (invw1 * vert1->texcoord[u][0]) - span.tex[u][0];
- dt = (invw1 * vert1->texcoord[u][1]) - span.tex[u][1];
- dr = (invw1 * vert1->texcoord[u][2]) - span.tex[u][2];
- dq = (invw1 * vert1->texcoord[u][3]) - span.tex[u][3];
- span.texStepX[u][0] = ds * invLen;
- span.texStepX[u][1] = dt * invLen;
- span.texStepX[u][2] = dr * invLen;
- span.texStepX[u][3] = dq * invLen;
- span.texStepY[u][0] = 0.0F;
- span.texStepY[u][1] = 0.0F;
- span.texStepY[u][2] = 0.0F;
- span.texStepY[u][3] = 0.0F;
- }
- }
+ const GLfloat invw0 = vert0->attrib[VARYING_SLOT_POS][3];
+ const GLfloat invw1 = vert1->attrib[VARYING_SLOT_POS][3];
+
+ span.attrStart[VARYING_SLOT_POS][3] = invw0;
+ span.attrStepX[VARYING_SLOT_POS][3] = (invw1 - invw0) * invLen;
+ span.attrStepY[VARYING_SLOT_POS][3] = 0.0;
+
+ ATTRIB_LOOP_BEGIN
+ if (swrast->_InterpMode[attr] == GL_FLAT) {
+ COPY_4V(span.attrStart[attr], vert1->attrib[attr]);
+ ASSIGN_4V(span.attrStepX[attr], 0.0, 0.0, 0.0, 0.0);
+ }
+ else {
+ GLuint c;
+ for (c = 0; c < 4; c++) {
+ float da;
+ span.attrStart[attr][c] = invw0 * vert0->attrib[attr][c];
+ da = (invw1 * vert1->attrib[attr][c]) - span.attrStart[attr][c];
+ span.attrStepX[attr][c] = da * invLen;
+ }
+ }
+ ASSIGN_4V(span.attrStepY[attr], 0.0, 0.0, 0.0, 0.0);
+ ATTRIB_LOOP_END