*/
#define FOG_LOOP(TYPE, COMPUTE_F) \
do { \
- const GLfloat fogStep = span->fogStep; \
- GLfloat fogCoord = span->fog; \
+ const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0]; \
+ GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0]; \
const GLfloat wStep = haveW ? span->dwdx : 0.0F; \
GLfloat w = haveW ? span->w : 1.0F; \
GLuint i; \
const GLfloat fogEnd = ctx->Fog.End;
const GLfloat fogScale = (ctx->Fog.Start == ctx->Fog.End)
? 1.0F : 1.0F / (ctx->Fog.End - ctx->Fog.Start);
- const GLfloat fogStep = span->fogStep;
- GLfloat fogCoord = span->fog;
+ const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0];
+ GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0];
const GLfloat wStep = haveW ? span->dwdx : 0.0F;
GLfloat w = haveW ? span->w : 1.0F;
GLuint i;
case GL_EXP:
{
const GLfloat density = -ctx->Fog.Density;
- const GLfloat fogStep = span->fogStep;
- GLfloat fogCoord = span->fog;
+ const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0];
+ GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0];
const GLfloat wStep = haveW ? span->dwdx : 0.0F;
GLfloat w = haveW ? span->w : 1.0F;
GLuint i;
case GL_EXP2:
{
const GLfloat negDensitySquared = -ctx->Fog.Density * ctx->Fog.Density;
- const GLfloat fogStep = span->fogStep;
- GLfloat fogCoord = span->fog;
+ const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0];
+ GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0];
const GLfloat wStep = haveW ? span->dwdx : 0.0F;
GLfloat w = haveW ? span->w : 1.0F;
GLuint i;
/* The span's fog start/step values are blend factors.
* They were previously computed per-vertex.
*/
- const GLfloat fogStep = span->fogStep;
- GLfloat fog = span->fog;
+ const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0];
+ GLfloat fog = span->attrStart[FRAG_ATTRIB_FOGC][0];
const GLfloat wStep = haveW ? span->dwdx : 0.0F;
GLfloat w = haveW ? span->w : 1.0F;
GLuint i;
break;
case FRAG_ATTRIB_COL1:
if (xOrY == 'X') {
- src[0] = span->dsrdx * (1.0F / CHAN_MAXF);
- src[1] = span->dsgdx * (1.0F / CHAN_MAXF);
- src[2] = span->dsbdx * (1.0F / CHAN_MAXF);
- src[3] = 0.0; /* XXX need this */
+ src[0] = span->attrStepX[FRAG_ATTRIB_COL1][0] * (1.0F / CHAN_MAXF);
+ src[1] = span->attrStepX[FRAG_ATTRIB_COL1][1] * (1.0F / CHAN_MAXF);
+ src[2] = span->attrStepX[FRAG_ATTRIB_COL1][2] * (1.0F / CHAN_MAXF);
+ src[3] = span->attrStepX[FRAG_ATTRIB_COL1][3] * (1.0F / CHAN_MAXF);
}
else {
- src[0] = span->dsrdy * (1.0F / CHAN_MAXF);
- src[1] = span->dsgdy * (1.0F / CHAN_MAXF);
- src[2] = span->dsbdy * (1.0F / CHAN_MAXF);
- src[3] = 0.0; /* XXX need this */
+ src[0] = span->attrStepY[FRAG_ATTRIB_COL1][0] * (1.0F / CHAN_MAXF);
+ src[1] = span->attrStepY[FRAG_ATTRIB_COL1][1] * (1.0F / CHAN_MAXF);
+ src[2] = span->attrStepY[FRAG_ATTRIB_COL1][2] * (1.0F / CHAN_MAXF);
+ src[3] = span->attrStepY[FRAG_ATTRIB_COL1][3] * (1.0F / CHAN_MAXF);
}
break;
case FRAG_ATTRIB_FOGC:
if (xOrY == 'X') {
- src[0] = span->dfogdx;
+ src[0] = span->attrStepX[FRAG_ATTRIB_FOGC][0] * (1.0F / CHAN_MAXF);
src[1] = 0.0;
src[2] = 0.0;
src[3] = 0.0;
}
else {
- src[0] = span->dfogdy;
+ src[0] = span->attrStepY[FRAG_ATTRIB_FOGC][0] * (1.0F / CHAN_MAXF);
src[1] = 0.0;
src[2] = 0.0;
src[3] = 0.0;
if (program->Base.InputsRead & FRAG_BIT_COL1) {
GLfloat *col1 = machine->Attribs[FRAG_ATTRIB_COL1][machine->CurFrag];
if (xOrY == 'X') {
- col1[0] += span->dsrdx * (1.0F / CHAN_MAXF);
- col1[1] += span->dsgdx * (1.0F / CHAN_MAXF);
- col1[2] += span->dsbdx * (1.0F / CHAN_MAXF);
- col1[3] += 0.0; /*XXX fix */
+ col1[0] += span->attrStepX[FRAG_ATTRIB_COL1][0] * (1.0F / CHAN_MAXF);
+ col1[1] += span->attrStepX[FRAG_ATTRIB_COL1][1] * (1.0F / CHAN_MAXF);
+ col1[2] += span->attrStepX[FRAG_ATTRIB_COL1][2] * (1.0F / CHAN_MAXF);
+ col1[3] += span->attrStepX[FRAG_ATTRIB_COL1][3] * (1.0F / CHAN_MAXF);
}
else {
- col1[0] += span->dsrdy * (1.0F / CHAN_MAXF);
- col1[1] += span->dsgdy * (1.0F / CHAN_MAXF);
- col1[2] += span->dsbdy * (1.0F / CHAN_MAXF);
- col1[3] += 0.0; /*XXX fix */
+ col1[0] += span->attrStepY[FRAG_ATTRIB_COL1][0] * (1.0F / CHAN_MAXF);
+ col1[1] += span->attrStepY[FRAG_ATTRIB_COL1][1] * (1.0F / CHAN_MAXF);
+ col1[2] += span->attrStepY[FRAG_ATTRIB_COL1][2] * (1.0F / CHAN_MAXF);
+ col1[3] += span->attrStepY[FRAG_ATTRIB_COL1][3] * (1.0F / CHAN_MAXF);
}
}
if (program->Base.InputsRead & FRAG_BIT_FOGC) {
GLfloat *fogc = machine->Attribs[FRAG_ATTRIB_FOGC][machine->CurFrag];
if (xOrY == 'X') {
- fogc[0] += span->dfogdx;
+ fogc[0] += span->attrStepX[FRAG_ATTRIB_FOGC][0];
}
else {
- fogc[0] += span->dfogdy;
+ fogc[0] += span->attrStepY[FRAG_ATTRIB_FOGC][0];
}
}
for (u = 0; u < ctx->Const.MaxTextureCoordUnits; u++) {
for (v = 0; v < ctx->Const.MaxVarying; v++) {
if (program->Base.InputsRead & FRAG_BIT_VAR(v)) {
GLfloat *var = machine->Attribs[FRAG_ATTRIB_VAR0 + v][machine->CurFrag];
+ GLuint attr = FRAG_ATTRIB_VAR0 + v;
if (xOrY == 'X') {
- var[0] += span->varStepX[v][0];
- var[1] += span->varStepX[v][1];
- var[2] += span->varStepX[v][2];
- var[3] += span->varStepX[v][3];
+ var[0] += span->attrStepX[attr][0];
+ var[1] += span->attrStepX[attr][1];
+ var[2] += span->attrStepX[attr][2];
+ var[3] += span->attrStepX[attr][3];
}
else {
- var[0] += span->varStepY[v][0];
- var[1] += span->varStepY[v][1];
- var[2] += span->varStepY[v][2];
- var[3] += span->varStepY[v][3];
+ var[0] += span->attrStepY[attr][0];
+ var[1] += span->attrStepY[attr][1];
+ var[2] += span->attrStepY[attr][2];
+ var[3] += span->attrStepY[attr][3];
}
}
}
#endif
#ifdef INTERP_FOG
interpFlags |= SPAN_FOG;
- span.fog = vert0->fog;
- span.fogStep = (vert1->fog - vert0->fog) / numPixels;
+ span.attrStart[FRAG_ATTRIB_FOGC][0] = vert0->fog;
+ span.attrStepX[FRAG_ATTRIB_FOGC][0] = (vert1->fog - vert0->fog) / numPixels;
#endif
#ifdef INTERP_TEX
interpFlags |= SPAN_TEXTURE;
GLuint v;
for (v = 0; v < MAX_VARYING; v++) {
if (inputsUsed & FRAG_BIT_VAR(v)) {
+ GLuint attr = FRAG_ATTRIB_VAR0 + v;
GLfloat ds, dt, dr, dq;
- span.var[v][0] = invw0 * vert0->varying[v][0];
- span.var[v][1] = invw0 * vert0->varying[v][1];
- span.var[v][2] = invw0 * vert0->varying[v][2];
- span.var[v][3] = invw0 * vert0->varying[v][3];
- ds = (invw1 * vert1->varying[v][0]) - span.var[v][0];
- dt = (invw1 * vert1->varying[v][1]) - span.var[v][1];
- dr = (invw1 * vert1->varying[v][2]) - span.var[v][2];
- dq = (invw1 * vert1->varying[v][3]) - span.var[v][3];
- span.varStepX[v][0] = ds * invLen;
- span.varStepX[v][1] = dt * invLen;
- span.varStepX[v][2] = dr * invLen;
- span.varStepX[v][3] = dq * invLen;
- span.varStepY[v][0] = 0.0F;
- span.varStepY[v][1] = 0.0F;
- span.varStepY[v][2] = 0.0F;
- span.varStepY[v][3] = 0.0F;
+ span.attrStart[attr][0] = invw0 * vert0->varying[v][0];
+ span.attrStart[attr][1] = invw0 * vert0->varying[v][1];
+ span.attrStart[attr][2] = invw0 * vert0->varying[v][2];
+ span.attrStart[attr][3] = invw0 * vert0->varying[v][3];
+ ds = (invw1 * vert1->varying[v][0]) - span.attrStart[attr][0];
+ dt = (invw1 * vert1->varying[v][1]) - span.attrStart[attr][1];
+ dr = (invw1 * vert1->varying[v][2]) - span.attrStart[attr][2];
+ dq = (invw1 * vert1->varying[v][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;
}
}
}
*/
span->interpMask = SPAN_FOG;
span->arrayMask = SPAN_XY | SPAN_Z;
- span->fog = vert->fog;
- span->fogStep = 0.0;
+ span->attrStart[FRAG_ATTRIB_FOGC][0] = vert->fog;
+ span->attrStepX[FRAG_ATTRIB_FOGC][0] = 0.0;
+ span->attrStepY[FRAG_ATTRIB_FOGC][0] = 0.0;
#if FLAGS & RGBA
span->arrayMask |= SPAN_RGBA;
#endif
void
_swrast_span_default_fog( GLcontext *ctx, SWspan *span )
{
- span->fog = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
- span->fogStep = span->dfogdx = span->dfogdy = 0.0F;
+ span->attrStart[FRAG_ATTRIB_FOGC][0] = _swrast_z_to_fogfactor(ctx, ctx->Current.RasterDistance);
+ span->attrStepX[FRAG_ATTRIB_FOGC][0] = 0.0;
+ span->attrStepY[FRAG_ATTRIB_FOGC][0] = 0.0;
span->interpMask |= SPAN_FOG;
}
interpolate_fog(const GLcontext *ctx, SWspan *span)
{
GLfloat (*fog)[4] = span->array->attribs[FRAG_ATTRIB_FOGC];
- const GLfloat fogStep = span->fogStep;
- GLfloat fogCoord = span->fog;
+ const GLfloat fogStep = span->attrStepX[FRAG_ATTRIB_FOGC][0];
+ GLfloat fogCoord = span->attrStart[FRAG_ATTRIB_FOGC][0];
const GLuint haveW = (span->interpMask & SPAN_W);
const GLfloat wStep = haveW ? span->dwdx : 0.0F;
GLfloat w = haveW ? span->w : 1.0F;
for (var = 0; var < MAX_VARYING; var++) {
if (inputsUsed & FRAG_BIT_VAR(var)) {
+ const GLuint attr = FRAG_ATTRIB_VAR0 + var;
GLuint j;
for (j = 0; j < 4; j++) {
- const GLfloat dvdx = span->varStepX[var][j];
- GLfloat v = span->var[var][j];
+ const GLfloat dvdx = span->attrStepX[attr][j];
+ GLfloat v = span->attrStart[attr][j];
const GLfloat dwdx = span->dwdx;
GLfloat w = span->w;
GLuint k;
for (k = 0; k < span->end; k++) {
GLfloat invW = 1.0f / w;
- span->array->attribs[FRAG_ATTRIB_VAR0 + var][k][j] = v * invW;
+ span->array->attribs[attr][k][j] = v * invW;
v += dvdx;
w += dwdx;
}
#endif
GLfixed index, indexStep;
GLfixed z, zStep; /* XXX z should probably be GLuint */
- GLfloat fog, fogStep;
GLfloat tex[MAX_TEXTURE_COORD_UNITS][4]; /* s, t, r, q */
GLfloat texStepX[MAX_TEXTURE_COORD_UNITS][4];
GLfloat texStepY[MAX_TEXTURE_COORD_UNITS][4];
GLfixed intTex[2], intTexStep[2]; /* s, t only */
- GLfloat var[MAX_VARYING][4];
- GLfloat varStepX[MAX_VARYING][4];
- GLfloat varStepY[MAX_VARYING][4];
+
+ /** Fragment attribute interpolants */
+ GLfloat attrStart[FRAG_ATTRIB_MAX][4]; /**< initial value */
+ GLfloat attrStepX[FRAG_ATTRIB_MAX][4]; /**< dvalue/dx */
+ GLfloat attrStepY[FRAG_ATTRIB_MAX][4]; /**< dvalue/dy */
/* partial derivatives wrt X and Y. */
GLfloat dzdx, dzdy;
GLfloat dgdx, dgdy;
GLfloat dbdx, dbdy;
GLfloat dadx, dady;
- GLfloat dsrdx, dsrdy;
- GLfloat dsgdx, dsgdy;
- GLfloat dsbdx, dsbdy;
- GLfloat dfogdx, dfogdy;
/**
* This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates
GLuint iv, ic; \
for (iv = 0; iv < MAX_VARYING; iv++) { \
if (inputsUsed & FRAG_BIT_VAR(iv)) { \
+ GLuint attr = FRAG_ATTRIB_VAR0 + iv; \
for (ic = 0; ic < 4; ic++) { \
CODE \
} \
const GLfloat eMaj_dfog = vMax->fog - vMin->fog;
const GLfloat eBot_dfog = vMid->fog - vMin->fog;
# endif
- span.dfogdx = oneOverArea * (eMaj_dfog * eBot.dy - eMaj.dy * eBot_dfog);
- span.dfogdy = oneOverArea * (eMaj.dx * eBot_dfog - eMaj_dfog * eBot.dx);
- span.fogStep = span.dfogdx;
+ span.attrStepX[FRAG_ATTRIB_FOGC][0] = oneOverArea * (eMaj_dfog * eBot.dy - eMaj.dy * eBot_dfog);
+ span.attrStepY[FRAG_ATTRIB_FOGC][0] = oneOverArea * (eMaj.dx * eBot_dfog - eMaj_dfog * eBot.dx);
}
#endif
#ifdef INTERP_RGB
GLfloat eBot_dsg = (GLfloat) ((ColorTemp) vMid->specular[GCOMP] - (ColorTemp) vMin->specular[GCOMP]);
GLfloat eMaj_dsb = (GLfloat) ((ColorTemp) vMax->specular[BCOMP] - (ColorTemp) vMin->specular[BCOMP]);
GLfloat eBot_dsb = (GLfloat) ((ColorTemp) vMid->specular[BCOMP] - (ColorTemp) vMin->specular[BCOMP]);
- span.dsrdx = oneOverArea * (eMaj_dsr * eBot.dy - eMaj.dy * eBot_dsr);
- span.dsrdy = oneOverArea * (eMaj.dx * eBot_dsr - eMaj_dsr * eBot.dx);
- span.dsgdx = oneOverArea * (eMaj_dsg * eBot.dy - eMaj.dy * eBot_dsg);
- span.dsgdy = oneOverArea * (eMaj.dx * eBot_dsg - eMaj_dsg * eBot.dx);
- span.dsbdx = oneOverArea * (eMaj_dsb * eBot.dy - eMaj.dy * eBot_dsb);
- span.dsbdy = oneOverArea * (eMaj.dx * eBot_dsb - eMaj_dsb * eBot.dx);
+ span.attrStepX[FRAG_ATTRIB_COL1][0] = oneOverArea * (eMaj_dsr * eBot.dy - eMaj.dy * eBot_dsr);
+ span.attrStepY[FRAG_ATTRIB_COL1][0] = oneOverArea * (eMaj.dx * eBot_dsr - eMaj_dsr * eBot.dx);
+ span.attrStepX[FRAG_ATTRIB_COL1][1] = oneOverArea * (eMaj_dsg * eBot.dy - eMaj.dy * eBot_dsg);
+ span.attrStepY[FRAG_ATTRIB_COL1][1] = oneOverArea * (eMaj.dx * eBot_dsg - eMaj_dsg * eBot.dx);
+ span.attrStepX[FRAG_ATTRIB_COL1][2] = oneOverArea * (eMaj_dsb * eBot.dy - eMaj.dy * eBot_dsb);
+ span.attrStepY[FRAG_ATTRIB_COL1][2] = oneOverArea * (eMaj.dx * eBot_dsb - eMaj_dsb * eBot.dx);
# if CHAN_TYPE == GL_FLOAT
- span.specRedStep = span.dsrdx;
+ span.specRedStep = span.attrStep[FRAG_ATTRIB_COL1][0];
span.specGreenStep = span.dsgdx;
span.specBlueStep = span.dsbdx;
# else
- span.specRedStep = SignedFloatToFixed(span.dsrdx);
- span.specGreenStep = SignedFloatToFixed(span.dsgdx);
- span.specBlueStep = SignedFloatToFixed(span.dsbdx);
+ span.specRedStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL1][0]);
+ span.specGreenStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL1][1]);
+ span.specBlueStep = SignedFloatToFixed(span.attrStepX[FRAG_ATTRIB_COL1][2]);
# endif
}
else {
- span.dsrdx = span.dsrdy = 0.0F;
- span.dsgdx = span.dsgdy = 0.0F;
- span.dsbdx = span.dsbdy = 0.0F;
+ span.attrStepX[FRAG_ATTRIB_COL1][0] = span.attrStepY[FRAG_ATTRIB_COL1][0] = 0.0F;
+ span.attrStepX[FRAG_ATTRIB_COL1][1] = span.attrStepY[FRAG_ATTRIB_COL1][1] = 0.0F;
+ span.attrStepX[FRAG_ATTRIB_COL1][2] = span.attrStepY[FRAG_ATTRIB_COL1][2] = 0.0F;
# if CHAN_TYPE == GL_FLOAT
span.specRedStep = 0.0F;
span.specGreenStep = 0.0F;
VARYING_LOOP(
GLfloat eMaj_dvar = vMax->varying[iv][ic] * wMax - vMin->varying[iv][ic] * wMin;
GLfloat eBot_dvar = vMid->varying[iv][ic] * wMid - vMin->varying[iv][ic] * wMin;
- span.varStepX[iv][ic] = oneOverArea * (eMaj_dvar * eBot.dy - eMaj.dy * eBot_dvar);
- span.varStepY[iv][ic] = oneOverArea * (eMaj.dx * eBot_dvar - eMaj_dvar * eBot.dx);
+ span.attrStepX[attr][ic] = oneOverArea * (eMaj_dvar * eBot.dy - eMaj.dy * eBot_dvar);
+ span.attrStepY[attr][ic] = oneOverArea * (eMaj.dx * eBot_dvar - eMaj_dvar * eBot.dx);
)
}
#endif
#endif
#ifdef INTERP_FOG
# ifdef INTERP_W
- fogLeft = vLower->fog * vLower->win[3] + (span.dfogdx * adjx + span.dfogdy * adjy) * (1.0F/FIXED_SCALE);
+ fogLeft = vLower->fog * vLower->win[3] + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE);
# else
- fogLeft = vLower->fog + (span.dfogdx * adjx + span.dfogdy * adjy) * (1.0F/FIXED_SCALE);
+ fogLeft = vLower->fog + (span.attrStepX[FRAG_ATTRIB_FOGC][0] * adjx + span.attrStepY[FRAG_ATTRIB_FOGC][0] * adjy) * (1.0F/FIXED_SCALE);
# endif
- dfogOuter = span.dfogdy + dxOuter * span.dfogdx;
+ dfogOuter = span.attrStepY[FRAG_ATTRIB_FOGC][0] + dxOuter * span.attrStepX[FRAG_ATTRIB_FOGC][0];
#endif
#ifdef INTERP_RGB
if (ctx->Light.ShadeModel == GL_SMOOTH) {
#ifdef INTERP_SPEC
if (ctx->Light.ShadeModel == GL_SMOOTH) {
# if CHAN_TYPE == GL_FLOAT
- srLeft = vLower->specular[RCOMP] + (span.dsrdx * adjx + span.dsrdy * adjy) * (1.0F / FIXED_SCALE);
- sgLeft = vLower->specular[GCOMP] + (span.dsgdx * adjx + span.dsgdy * adjy) * (1.0F / FIXED_SCALE);
- sbLeft = vLower->specular[BCOMP] + (span.dsbdx * adjx + span.dsbdy * adjy) * (1.0F / FIXED_SCALE);
- dsrOuter = span.dsrdy + dxOuter * span.dsrdx;
- dsgOuter = span.dsgdy + dxOuter * span.dsgdx;
- dsbOuter = span.dsbdy + dxOuter * span.dsbdx;
+ srLeft = vLower->specular[RCOMP] + (span.attrStepX[FRAG_ATTRIB_COL1][0] * adjx + span.attrStepY[FRAG_ATTRIB_COL1][0] * adjy) * (1.0F / FIXED_SCALE);
+ sgLeft = vLower->specular[GCOMP] + (span.attrStepX[FRAG_ATTRIB_COL1][1] * adjx + span.attrStepY[FRAG_ATTRIB_COL1][1] * adjy) * (1.0F / FIXED_SCALE);
+ sbLeft = vLower->specular[BCOMP] + (span.attrStepX[FRAG_ATTRIB_COL1][2] * adjx + span.attrStepY[FRAG_ATTRIB_COL1][2] * adjy) * (1.0F / FIXED_SCALE);
+ dsrOuter = span.attrStepY[FRAG_ATTRIB_COL1][0] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL1][0];
+ dsgOuter = span.attrStepY[FRAG_ATTRIB_COL1][1] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL1][1];
+ dsbOuter = span.attrStepY[FRAG_ATTRIB_COL1][2] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL1][2];
# else
- srLeft = (GLfixed) (ChanToFixed(vLower->specular[RCOMP]) + span.dsrdx * adjx + span.dsrdy * adjy) + FIXED_HALF;
- sgLeft = (GLfixed) (ChanToFixed(vLower->specular[GCOMP]) + span.dsgdx * adjx + span.dsgdy * adjy) + FIXED_HALF;
- sbLeft = (GLfixed) (ChanToFixed(vLower->specular[BCOMP]) + span.dsbdx * adjx + span.dsbdy * adjy) + FIXED_HALF;
- dsrOuter = SignedFloatToFixed(span.dsrdy + dxOuter * span.dsrdx);
- dsgOuter = SignedFloatToFixed(span.dsgdy + dxOuter * span.dsgdx);
- dsbOuter = SignedFloatToFixed(span.dsbdy + dxOuter * span.dsbdx);
+ srLeft = (GLfixed) (ChanToFixed(vLower->specular[RCOMP]) + span.attrStepX[FRAG_ATTRIB_COL1][0] * adjx + span.attrStepY[FRAG_ATTRIB_COL1][0] * adjy) + FIXED_HALF;
+ sgLeft = (GLfixed) (ChanToFixed(vLower->specular[GCOMP]) + span.attrStepX[FRAG_ATTRIB_COL1][1] * adjx + span.attrStepY[FRAG_ATTRIB_COL1][1] * adjy) + FIXED_HALF;
+ sbLeft = (GLfixed) (ChanToFixed(vLower->specular[BCOMP]) + span.attrStepX[FRAG_ATTRIB_COL1][2] * adjx + span.attrStepY[FRAG_ATTRIB_COL1][2] * adjy) + FIXED_HALF;
+ dsrOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL1][0] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL1][0]);
+ dsgOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL1][1] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL1][1]);
+ dsbOuter = SignedFloatToFixed(span.attrStepY[FRAG_ATTRIB_COL1][2] + dxOuter * span.attrStepX[FRAG_ATTRIB_COL1][2]);
# endif
}
else {
VARYING_LOOP(
const GLfloat invW = vLower->win[3];
const GLfloat var0 = vLower->varying[iv][ic] * invW;
- varLeft[iv][ic] = var0 + (span.varStepX[iv][ic] * adjx +
- span.varStepY[iv][ic] * adjy) * (1.0f / FIXED_SCALE);
- dvarOuter[iv][ic] = span.varStepY[iv][ic] + dxOuter * span.varStepX[iv][ic];
+ varLeft[iv][ic] = var0 + (span.attrStepX[attr][ic] * adjx +
+ span.attrStepY[attr][ic] * adjy) * (1.0f / FIXED_SCALE);
+ dvarOuter[iv][ic] = span.attrStepY[attr][ic] + dxOuter * span.attrStepX[attr][ic];
)
#endif
} /*if setupLeft*/
dwInner = dwOuter + span.dwdx;
#endif
#ifdef INTERP_FOG
- dfogInner = dfogOuter + span.dfogdx;
+ dfogInner = dfogOuter + span.attrStepX[FRAG_ATTRIB_FOGC][0];
#endif
#ifdef INTERP_RGB
fdrInner = fdrOuter + span.redStep;
#endif
#ifdef INTERP_VARYING
VARYING_LOOP(
- dvarInner[iv][ic] = dvarOuter[iv][ic] + span.varStepX[iv][ic];
+ dvarInner[iv][ic] = dvarOuter[iv][ic] + span.attrStepX[attr][ic];
)
#endif
span.w = wLeft;
#endif
#ifdef INTERP_FOG
- span.fog = fogLeft;
+ span.attrStart[FRAG_ATTRIB_FOGC][0] = fogLeft;
#endif
#ifdef INTERP_RGB
span.red = rLeft;
#endif
#ifdef INTERP_VARYING
VARYING_LOOP(
- span.var[iv][ic] = varLeft[iv][ic];
+ span.attrStart[attr][ic] = varLeft[iv][ic];
)
#endif
/* copy fog interp info */
- zoomed.fog = span->fog;
- zoomed.fogStep = span->fogStep;
+ zoomed.attrStart[FRAG_ATTRIB_FOGC][0] = span->attrStart[FRAG_ATTRIB_FOGC][0];
+ zoomed.attrStepX[FRAG_ATTRIB_FOGC][0] = span->attrStepX[FRAG_ATTRIB_FOGC][0];
+ zoomed.attrStepY[FRAG_ATTRIB_FOGC][0] = span->attrStepY[FRAG_ATTRIB_FOGC][0];
/* XXX copy texcoord info? */
if (format == GL_RGBA || format == GL_RGB) {