aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/tnl
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2005-04-28 21:14:00 +0000
committerBrian Paul <[email protected]>2005-04-28 21:14:00 +0000
commitd59054e60bd98f42f41f53f96c782b0dc713f13c (patch)
treec2b91ddf67b97c1173736d9c3bf25a8665fdee91 /src/mesa/tnl
parent5cef1a1fedc583a5860f260d53b9b188a05f1e16 (diff)
fix _tnl_copy_to_current() so that current edge flag and rasterpos aren't trashed by color index updates
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r--src/mesa/tnl/t_vtx_api.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mesa/tnl/t_vtx_api.c b/src/mesa/tnl/t_vtx_api.c
index b9ad28e67db..129b19c5f96 100644
--- a/src/mesa/tnl/t_vtx_api.c
+++ b/src/mesa/tnl/t_vtx_api.c
@@ -142,7 +142,7 @@ static void _tnl_copy_to_current( GLcontext *ctx )
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint i;
- for (i = _TNL_ATTRIB_POS+1 ; i <= _TNL_ATTRIB_EDGEFLAG ; i++)
+ for (i = _TNL_ATTRIB_POS+1 ; i < _TNL_ATTRIB_INDEX ; i++) {
if (tnl->vtx.attrsz[i]) {
/* Note: the tnl->vtx.current[i] pointers points to
* the ctx->Current fields. The first 16 or so, anyway.
@@ -151,6 +151,14 @@ static void _tnl_copy_to_current( GLcontext *ctx )
tnl->vtx.attrsz[i],
tnl->vtx.attrptr[i]);
}
+ }
+
+ /* color index is special (it's not a float[4] so COPY_CLEAN_4V above
+ * will trash adjacent memory!)
+ */
+ if (tnl->vtx.attrsz[_TNL_ATTRIB_INDEX]) {
+ ctx->Current.Index = tnl->vtx.attrptr[_TNL_ATTRIB_INDEX][0];
+ }
/* Edgeflag requires additional treatment:
*/