Add missing cases for viewport transform. Remove INVALIDATE_STORED_VERTICS
authorKeith Whitwell <keith@tungstengraphics.com>
Mon, 5 Mar 2001 16:41:47 +0000 (16:41 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Mon, 5 Mar 2001 16:41:47 +0000 (16:41 +0000)
macro

src/mesa/drivers/common/t_dd_vb.c
src/mesa/drivers/common/t_dd_vbtmp.h

index 7b6f3bd25f419594dff76101cded605cf9f7231b..0a3f0fcfb26fc7c4090ffd581f613a45ed25fd84 100644 (file)
@@ -74,11 +74,18 @@ void TAG(translate_vertex)(GLcontext *ctx,
    UNVIEWPORT_VARS;
 
    if (format == TINY_VERTEX_FORMAT) {
-      dst->win[0] =   s[0]  * src->v.x + s[12];
-      dst->win[1] =   s[5]  * src->v.y + s[13];
-      dst->win[2] =   s[10] * src->v.z + s[14];
-      dst->win[3] =   1.0;
-      
+      if (HAVE_HW_VIEWPORT) {
+        dst->win[0] = s[0]  * src->v.x + s[12];
+        dst->win[1] = s[5]  * src->v.y + s[13];
+        dst->win[2] = s[10] * src->v.z + s[14];
+        dst->win[3] = 1.0;
+      } else {
+        dst->win[0] = UNVIEWPORT_X( src->v.x );
+        dst->win[1] = UNVIEWPORT_Y( src->v.y );
+        dst->win[2] = UNVIEWPORT_Z( src->v.z );
+        dst->win[3] = 1.0;
+      }
+
       dst->color[0] = src->tv.color.red;
       dst->color[1] = src->tv.color.green;
       dst->color[2] = src->tv.color.blue;
@@ -88,10 +95,17 @@ void TAG(translate_vertex)(GLcontext *ctx,
       GLfloat oow = (HAVE_HW_DIVIDE) ? 1.0 / src->v.w : src->v.w;
 
       if (HAVE_HW_VIEWPORT) {
-        dst->win[0] = s[0]  * src->v.x * oow + s[12];
-        dst->win[1] = s[5]  * src->v.y * oow + s[13];
-        dst->win[2] = s[10] * src->v.z * oow + s[14];
-        dst->win[3] = oow;
+        if (HAVE_HW_DIVIDE) {
+           dst->win[0] = s[0]  * src->v.x * oow + s[12];
+           dst->win[1] = s[5]  * src->v.y * oow + s[13];
+           dst->win[2] = s[10] * src->v.z * oow + s[14];
+           dst->win[3] = oow;
+        } else {
+           dst->win[0] = s[0]  * src->v.x + s[12];
+           dst->win[1] = s[5]  * src->v.y + s[13];
+           dst->win[2] = s[10] * src->v.z + s[14];
+           dst->win[3] = oow;
+        }
       } else {
         dst->win[0] = UNVIEWPORT_X( src->v.x );
         dst->win[1] = UNVIEWPORT_Y( src->v.y );
@@ -111,7 +125,7 @@ void TAG(translate_vertex)(GLcontext *ctx,
       dst->fog = src->v.color.alpha/255.0;
 
       if (HAVE_PTEX_VERTICES && 
-         ((HAVE_TEX2_VERTICES && format == PROJ_TEX3_VERTEX_FORMAT) ||
+         ((HAVE_TEX2_VERTICES && fbormat == PROJ_TEX3_VERTEX_FORMAT) ||
           (format == PROJ_TEX1_VERTEX_FORMAT))) {
 
         dst->texcoord[0][0] = src->pv.u0;
index 8be88a2261a710745c87844d00f4ed836c15c5dd..4b7c1cb9f0f6dfdd55ecd005755eb406f34148b2 100644 (file)
 #error "can't cope with this combination"
 #endif
 
+
 #if (HAVE_HW_DIVIDE || DO_SPEC || DO_TEX0 || DO_FOG || !HAVE_TINY_VERTICES)
 
 static void TAG(emit)( GLcontext *ctx,
@@ -373,10 +374,6 @@ static void TAG(emit)( GLcontext *ctx,
         }
       }
    }
-
-   if (DO_PTEX && !HAVE_PTEX_VERTICES) {
-      INVALIDATE_STORED_VERTICES();
-   }
 }
 #else 
 #if DO_XYZW