additional checks that attr is a texcoord
authorKeith Packard <keithp@keithp.com>
Sat, 28 Apr 2007 13:50:06 +0000 (07:50 -0600)
committerBrian <brian@yutani.localnet.net>
Sat, 28 Apr 2007 13:50:06 +0000 (07:50 -0600)
src/mesa/swrast/s_aalinetemp.h
src/mesa/swrast/s_aatritemp.h
src/mesa/swrast/s_pointtemp.h

index 402d64b9f758a88a169d9730494a855850e92d13..80cec0b31d40e2f1507fedc94410227c5cdc48a8 100644 (file)
@@ -93,7 +93,7 @@ NAME(plot)(GLcontext *ctx, struct LineInfo *line, int ix, int iy)
       attribArray[i][0] = solve_plane(fx, fy, line->sPlane[attr]) * invQ;
       attribArray[i][1] = solve_plane(fx, fy, line->tPlane[attr]) * invQ;
       attribArray[i][2] = solve_plane(fx, fy, line->uPlane[attr]) * invQ;
-      if (attr < FRAG_ATTRIB_VAR0) {
+      if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) {
          const GLuint unit = attr - FRAG_ATTRIB_TEX0;
          line->span.array->lambda[unit][i]
             = compute_lambda(line->sPlane[attr],
@@ -220,7 +220,7 @@ NAME(line)(GLcontext *ctx, const SWvertex *v0, const SWvertex *v1)
          compute_plane(line.x0, line.y0, line.x1, line.y1, t0, t1, line.tPlane[attr]);
          compute_plane(line.x0, line.y0, line.x1, line.y1, r0, r1, line.uPlane[attr]);
          compute_plane(line.x0, line.y0, line.x1, line.y1, q0, q1, line.vPlane[attr]);
-         if (attr < FRAG_ATTRIB_VAR0) {
+         if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) {
             const GLuint u = attr - FRAG_ATTRIB_TEX0;
             const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
             const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
index 39456cc192b76cebffb621b7ecf8d03d6d786dce..4162ed685324fc290bcda070d0e2ae09b8da446b 100644 (file)
          compute_plane(p0, p1, p2, t0, t1, t2, tPlane[attr]);
          compute_plane(p0, p1, p2, r0, r1, r2, uPlane[attr]);
          compute_plane(p0, p1, p2, q0, q1, q2, vPlane[attr]);
-         if (attr < FRAG_ATTRIB_VAR0) {
+         if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) {
             const GLuint u = attr - FRAG_ATTRIB_TEX0;
             const struct gl_texture_object *obj = ctx->Texture.Unit[u]._Current;
             const struct gl_texture_image *texImage = obj->Image[0][obj->BaseLevel];
                array->attribs[attr][count][0] = solve_plane(cx, cy, sPlane[attr]) * invQ;
                array->attribs[attr][count][1] = solve_plane(cx, cy, tPlane[attr]) * invQ;
                array->attribs[attr][count][2] = solve_plane(cx, cy, uPlane[attr]) * invQ;
-               if (attr < FRAG_ATTRIB_VAR0) {
+               if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) {
                   const GLuint unit = attr - FRAG_ATTRIB_TEX0;
                   array->lambda[unit][count] = compute_lambda(sPlane[attr], tPlane[attr],
                                                               vPlane[attr], cx, cy, invQ,
                array->attribs[attr][ix][0] = solve_plane(cx, cy, sPlane[attr]) * invQ;
                array->attribs[attr][ix][1] = solve_plane(cx, cy, tPlane[attr]) * invQ;
                array->attribs[attr][ix][2] = solve_plane(cx, cy, uPlane[attr]) * invQ;
-               if (attr < FRAG_ATTRIB_VAR0) {
+               if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) {
                   const GLuint unit = attr - FRAG_ATTRIB_TEX0;
                   array->lambda[unit][ix] = compute_lambda(sPlane[attr],
                                                            tPlane[attr],
index d118a532a45a9cd188bdeb5d7e1c304a2b3a856f..dddc2f7f40c630b83fdbaf67ccab15f0cc5174cc 100644 (file)
@@ -275,7 +275,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
 #if FLAGS & ATTRIBS
             ATTRIB_LOOP_BEGIN
                COPY_4V(span->array->attribs[attr][count], attrib[attr]);
-               if (attr < FRAG_ATTRIB_VAR0) {
+               if (attr < FRAG_ATTRIB_VAR0 && attr >= FRAG_ATTRIB_TEX0) {
                   const GLuint u = attr - FRAG_ATTRIB_TEX0;
                   span->array->lambda[u][count] = 0.0;
                }