summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_linetemp.h
diff options
context:
space:
mode:
authorBrian <brian@yutani.localnet.net>2007-02-02 11:01:01 -0700
committerBrian <brian@yutani.localnet.net>2007-02-02 11:01:01 -0700
commit9ab512ad8cf3a12f4f7f8494fa99bc9389f217db (patch)
tree4026b0a39ff5c0403372f8f396786b9b592dcc48 /src/mesa/swrast/s_linetemp.h
parent462d8f5fafcc5ac69ea89cac1222abadded642e2 (diff)
Replace color, z, w, texture interpolants with new generic attrib interpolants.
Diffstat (limited to 'src/mesa/swrast/s_linetemp.h')
-rw-r--r--src/mesa/swrast/s_linetemp.h71
1 files changed, 36 insertions, 35 deletions
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index d68868ded9..e3ca4bd0ac 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -286,22 +286,22 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
const GLfloat invw1 = vert1->win[3];
const GLfloat invLen = 1.0F / numPixels;
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;
+ span.attrStart[FRAG_ATTRIB_TEX0][0] = invw0 * vert0->texcoord[0][0];
+ span.attrStart[FRAG_ATTRIB_TEX0][1] = invw0 * vert0->texcoord[0][1];
+ span.attrStart[FRAG_ATTRIB_TEX0][2] = invw0 * vert0->texcoord[0][2];
+ span.attrStart[FRAG_ATTRIB_TEX0][3] = invw0 * vert0->texcoord[0][3];
+ ds = (invw1 * vert1->texcoord[0][0]) - span.attrStart[FRAG_ATTRIB_TEX0][0];
+ dt = (invw1 * vert1->texcoord[0][1]) - span.attrStart[FRAG_ATTRIB_TEX0][1];
+ dr = (invw1 * vert1->texcoord[0][2]) - span.attrStart[FRAG_ATTRIB_TEX0][2];
+ dq = (invw1 * vert1->texcoord[0][3]) - span.attrStart[FRAG_ATTRIB_TEX0][3];
+ span.attrStepX[FRAG_ATTRIB_TEX0][0] = ds * invLen;
+ span.attrStepX[FRAG_ATTRIB_TEX0][1] = dt * invLen;
+ span.attrStepX[FRAG_ATTRIB_TEX0][2] = dr * invLen;
+ span.attrStepX[FRAG_ATTRIB_TEX0][3] = dq * invLen;
+ span.attrStepY[FRAG_ATTRIB_TEX0][0] = 0.0F;
+ span.attrStepY[FRAG_ATTRIB_TEX0][1] = 0.0F;
+ span.attrStepY[FRAG_ATTRIB_TEX0][2] = 0.0F;
+ span.attrStepY[FRAG_ATTRIB_TEX0][3] = 0.0F;
}
#endif
#ifdef INTERP_MULTITEX
@@ -311,25 +311,26 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
GLuint u;
for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
if (ctx->Texture.Unit[u]._ReallyEnabled) {
+ const GLuint attr = FRAG_ATTRIB_TEX0 + u;
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;
+ span.attrStart[attr][0] = invw0 * vert0->texcoord[u][0];
+ span.attrStart[attr][1] = invw0 * vert0->texcoord[u][1];
+ span.attrStart[attr][2] = invw0 * vert0->texcoord[u][2];
+ span.attrStart[attr][3] = invw0 * vert0->texcoord[u][3];
+ ds = (invw1 * vert1->texcoord[u][0]) - span.attrStart[attr][0];
+ dt = (invw1 * vert1->texcoord[u][1]) - span.attrStart[attr][1];
+ dr = (invw1 * vert1->texcoord[u][2]) - span.attrStart[attr][2];
+ dq = (invw1 * vert1->texcoord[u][3]) - span.attrStart[attr][3];
+ span.attrStepX[attr][0] = ds * invLen;
+ span.attrStepX[attr][1] = dt * invLen;
+ span.attrStepX[attr][2] = dr * invLen;
+ span.attrStepX[attr][3] = dq * invLen;
+ span.attrStepY[attr][0] = 0.0F;
+ span.attrStepY[attr][1] = 0.0F;
+ span.attrStepY[attr][2] = 0.0F;
+ span.attrStepY[attr][3] = 0.0F;
}
}
}
@@ -371,9 +372,9 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
INIT_SPAN(span, GL_LINE, numPixels, interpFlags, SPAN_XY);
/* Need these for fragment prog texcoord interpolation */
- span.w = 1.0F;
- span.dwdx = 0.0F;
- span.dwdy = 0.0F;
+ span.attrStart[FRAG_ATTRIB_WPOS][3] = 1.0F;
+ span.attrStepX[FRAG_ATTRIB_WPOS][3] = 0.0F;
+ span.attrStepY[FRAG_ATTRIB_WPOS][3] = 0.0F;
/*
* Draw