diff options
Diffstat (limited to 'src/mesa/swrast/s_linetemp.h')
-rw-r--r-- | src/mesa/swrast/s_linetemp.h | 71 |
1 files changed, 36 insertions, 35 deletions
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h index d68868ded98..e3ca4bd0ac1 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 |