- const struct gl_texture_object *obj = ctx->Texture.Unit[0]._Current;
- const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
- const GLfloat invW0 = v0->win[3];
- const GLfloat invW1 = v1->win[3];
- const GLfloat s0 = v0->texcoord[0][0] * invW0;
- const GLfloat s1 = v1->texcoord[0][0] * invW1;
- const GLfloat t0 = v0->texcoord[0][1] * invW0;
- const GLfloat t1 = v1->texcoord[0][1] * invW1;
- const GLfloat r0 = v0->texcoord[0][2] * invW0;
- const GLfloat r1 = v1->texcoord[0][2] * invW1;
- const GLfloat q0 = v0->texcoord[0][3] * invW0;
- const GLfloat q1 = v1->texcoord[0][3] * invW1;
- line.span.arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
- compute_plane(line.x0, line.y0, line.x1, line.y1, s0, s1, line.sPlane[0]);
- compute_plane(line.x0, line.y0, line.x1, line.y1, t0, t1, line.tPlane[0]);
- compute_plane(line.x0, line.y0, line.x1, line.y1, r0, r1, line.uPlane[0]);
- compute_plane(line.x0, line.y0, line.x1, line.y1, q0, q1, line.vPlane[0]);
- line.texWidth[0] = (GLfloat) texImage->Width;
- line.texHeight[0] = (GLfloat) texImage->Height;
- }
-#elif defined(DO_MULTITEX)
- {
- GLuint u;
- line.span.arrayMask |= (SPAN_TEXTURE | SPAN_LAMBDA);
- for (u = 0; u < ctx->Const.MaxTextureUnits; u++) {
- if (ctx->Texture.Unit[u]._ReallyEnabled) {
+ const GLfloat invW0 = v0->attrib[FRAG_ATTRIB_WPOS][3];
+ const GLfloat invW1 = v1->attrib[FRAG_ATTRIB_WPOS][3];
+ line.span.arrayMask |= SPAN_LAMBDA;
+ compute_plane(line.x0, line.y0, line.x1, line.y1, invW0, invW1, line.wPlane);
+ ATTRIB_LOOP_BEGIN
+ GLuint c;
+ if (swrast->_InterpMode[attr] == GL_FLAT) {
+ for (c = 0; c < 4; c++) {
+ constant_plane(v1->attrib[attr][c], line.attrPlane[attr][c]);
+ }
+ }
+ else {
+ for (c = 0; c < 4; c++) {
+ const GLfloat a0 = v0->attrib[attr][c] * invW0;
+ const GLfloat a1 = v1->attrib[attr][c] * invW1;
+ compute_plane(line.x0, line.y0, line.x1, line.y1, a0, a1,
+ line.attrPlane[attr][c]);
+ }
+ }
+ line.span.arrayAttribs |= (1 << attr);
+ if (attr >= FRAG_ATTRIB_TEX0 && attr < FRAG_ATTRIB_VAR0) {
+ const GLuint u = attr - FRAG_ATTRIB_TEX0;