summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_linetemp.h
diff options
context:
space:
mode:
authorBrian <brian@nostromo.localnet.net>2007-04-23 21:21:52 -0600
committerBrian <brian@nostromo.localnet.net>2007-04-23 21:21:52 -0600
commit0bdf216dd06d5136b8529297297aa962bab548c2 (patch)
treebb7c516d3d6f2e818f2cbb0f8865a45fecf053c6 /src/mesa/swrast/s_linetemp.h
parentd59e6f233b02ffe2c36c2fb89ec26c208a421540 (diff)
Improve the code for interpolating fragment attributes a little. More to come...
Diffstat (limited to 'src/mesa/swrast/s_linetemp.h')
-rw-r--r--src/mesa/swrast/s_linetemp.h41
1 files changed, 19 insertions, 22 deletions
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index 7b66291eb5..6c52e8dd47 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -314,28 +314,25 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
const GLfloat invLen = 1.0F / numPixels;
const GLfloat invw0 = vert0->win[3];
const GLfloat invw1 = vert1->win[3];
- GLuint attr;
- for (attr = swrast->_MinFragmentAttrib; attr < swrast->_MaxFragmentAttrib; attr++) {
- if (swrast->_FragmentAttribs & (1 << attr)) {
- GLfloat ds, dt, dr, dq;
- span.attrStart[attr][0] = invw0 * vert0->attrib[attr][0];
- span.attrStart[attr][1] = invw0 * vert0->attrib[attr][1];
- span.attrStart[attr][2] = invw0 * vert0->attrib[attr][2];
- span.attrStart[attr][3] = invw0 * vert0->attrib[attr][3];
- ds = (invw1 * vert1->attrib[attr][0]) - span.attrStart[attr][0];
- dt = (invw1 * vert1->attrib[attr][1]) - span.attrStart[attr][1];
- dr = (invw1 * vert1->attrib[attr][2]) - span.attrStart[attr][2];
- dq = (invw1 * vert1->attrib[attr][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;
- }
- }
+ ATTRIB_LOOP_BEGIN
+ GLfloat ds, dt, dr, dq;
+ span.attrStart[attr][0] = invw0 * vert0->attrib[attr][0];
+ span.attrStart[attr][1] = invw0 * vert0->attrib[attr][1];
+ span.attrStart[attr][2] = invw0 * vert0->attrib[attr][2];
+ span.attrStart[attr][3] = invw0 * vert0->attrib[attr][3];
+ ds = (invw1 * vert1->attrib[attr][0]) - span.attrStart[attr][0];
+ dt = (invw1 * vert1->attrib[attr][1]) - span.attrStart[attr][1];
+ dr = (invw1 * vert1->attrib[attr][2]) - span.attrStart[attr][2];
+ dq = (invw1 * vert1->attrib[attr][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;
+ ATTRIB_LOOP_END
}
#endif