Simplify last fix slightly, apply to vtx paths as well.
authorKeith Whitwell <keith@tungstengraphics.com>
Tue, 20 Apr 2004 10:28:15 +0000 (10:28 +0000)
committerKeith Whitwell <keith@tungstengraphics.com>
Tue, 20 Apr 2004 10:28:15 +0000 (10:28 +0000)
src/mesa/tnl/t_save_api.c
src/mesa/tnl/t_vtx_api.c

index dce84e212cda97f641f46ed7c007f8a89d7eab55..f0f573c09049204ad8203d2abdd43ec9deb6b7df 100644 (file)
@@ -503,10 +503,7 @@ static void _save_upgrade_vertex( GLcontext *ctx,
                     dest += newsz;
                  }
                  else {
-                    GLuint currentsz = tnl->save.currentsz[attr][0];
-                    GLfloat *current = tnl->save.current[attr];
-                    ASSIGN_4V( dest, 0, 0, 0, 1 );
-                    COPY_SZ_4V( dest, currentsz, current );
+                    COPY_SZ_4V( dest, newsz, tnl->save.current[attr] );
                     dest += newsz;
                  }
               }
index 52036aa996ccf05f8f7d7adaedaf6fd2014ca375..7eccacc50473208a7b6e494ee39a63174eb2ba72 100644 (file)
@@ -275,10 +275,15 @@ static void _tnl_wrap_upgrade_vertex( GLcontext *ctx,
         for (j = 0 ; j < _TNL_ATTRIB_MAX ; j++) {
            if (tnl->vtx.attrsz[j]) {
               if (j == attr) {
-                 COPY_SZ_4V( dest, newsz, tnl->vtx.current[j] );
-                 COPY_SZ_4V( dest, oldsz, data );
-                 data += oldsz;
-                 dest += newsz;
+                 if (oldsz) {
+                    ASSIGN_4V( dest, 0, 0, 0, 1 );
+                    COPY_SZ_4V( dest, oldsz, data );
+                    data += oldsz;
+                    dest += newsz;
+                 } else {
+                    COPY_SZ_4V( dest, newsz, tnl->vtx.current[j] );
+                    dest += newsz;
+                 }
               }
               else {
                  GLuint sz = tnl->vtx.attrsz[j];