From 44d4a8f64521fe9d398ecca5dc886171d8a40a7e Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 6 Jan 2004 00:18:03 +0000 Subject: [PATCH] Apply attribute offset when calling extract(). Simplify stride calcs. --- src/mesa/tnl/t_vertex.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mesa/tnl/t_vertex.c b/src/mesa/tnl/t_vertex.c index c8cfb6e1065..8ae8e746488 100644 --- a/src/mesa/tnl/t_vertex.c +++ b/src/mesa/tnl/t_vertex.c @@ -681,7 +681,7 @@ static void generic_emit( GLcontext *ctx, for (j = 0; j < count; j++) { GLvector4f *vptr = VB->AttribPtr[a[j].attrib]; a[j].inputstride = vptr->stride; - a[j].inputptr = (GLubyte *)STRIDE_4F(vptr->data, start * vptr->stride); + a[j].inputptr = ((GLubyte *)vptr->data) + start * vptr->stride; a[j].emit = a[j].insert[vptr->size - 1]; } @@ -921,7 +921,7 @@ void _tnl_get_attr( GLcontext *ctx, const void *vin, for (j = 0; j < attr_count; j++) { if (a[j].attrib == attr) { - a[j].extract( &a[j], dest, vin ); + a[j].extract( &a[j], dest, (GLubyte *)vin + a[j].vertoffset ); return; } } @@ -979,6 +979,9 @@ GLuint _tnl_install_attrs( GLcontext *ctx, const struct tnl_attr_map *map, else vtx->attr[i].vertoffset = offset; +/* fprintf(stderr, "%d: %s offset %d\n", i, */ +/* format_info[format].name, vtx->attr[i].vertoffset); */ + offset += format_info[format].attrsize; } -- 2.11.0