summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/tnl/t_save_api.c5
-rw-r--r--src/mesa/tnl/t_vtx_api.c13
2 files changed, 10 insertions, 8 deletions
diff --git a/src/mesa/tnl/t_save_api.c b/src/mesa/tnl/t_save_api.c
index dce84e212cd..f0f573c0904 100644
--- a/src/mesa/tnl/t_save_api.c
+++ b/src/mesa/tnl/t_save_api.c
@@ -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;
}
}
diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c
index 52036aa996c..7eccacc5047 100644
--- a/src/mesa/tnl/t_vtx_api.c
+++ b/src/mesa/tnl/t_vtx_api.c
@@ -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];