From 36a0a3252e1e20df69b53f70ba93bc74c4a4bf0e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 8 Apr 2003 02:27:16 +0000 Subject: Added ctx->Texture._EnabledCoordUnits bitfield. Fixed some vertex array / vertex program glitches with glDrawElements. Fixed some fragment program runtime bugs. Non-trivial Cg programs are running now. --- src/mesa/tnl/t_array_import.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'src/mesa/tnl/t_array_import.c') diff --git a/src/mesa/tnl/t_array_import.c b/src/mesa/tnl/t_array_import.c index 2a8506aa42..fbcb9b3310 100644 --- a/src/mesa/tnl/t_array_import.c +++ b/src/mesa/tnl/t_array_import.c @@ -1,4 +1,4 @@ -/* $Id: t_array_import.c,v 1.28 2003/03/01 01:50:26 brianp Exp $ */ +/* $Id: t_array_import.c,v 1.29 2003/04/08 02:27:19 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -363,6 +363,22 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLsizei count ) _ac_import_range( ctx, start, count ); + /* When vertex program mode is enabled, the generic vertex program + * attribute arrays have priority over the conventional attributes. + * Try to use them now. + */ + if (ctx->VertexProgram.Enabled) { + GLuint index; + for (index = 0; index < VERT_ATTRIB_MAX; index++) { + /* XXX check program->InputsRead to reduce work here */ + _tnl_import_attrib( ctx, index, GL_FALSE, GL_TRUE ); + VB->AttribPtr[index] = &tmp->Attribs[index]; + } + } + + /* + * Conventional attributes + */ if (inputs & VERT_BIT_POS) { _tnl_import_vertex( ctx, 0, 0 ); tmp->Obj.count = VB->Count; @@ -418,14 +434,4 @@ void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLsizei count ) VB->SecondaryColorPtr[1] = 0; } } - - /* XXX not 100% sure this is finished. Keith should probably inspect. */ - if (ctx->VertexProgram.Enabled) { - GLuint index; - for (index = 0; index < VERT_ATTRIB_MAX; index++) { - /* XXX check program->InputsRead to reduce work here */ - _tnl_import_attrib( ctx, index, GL_FALSE, GL_TRUE ); - VB->AttribPtr[index] = &tmp->Attribs[index]; - } - } } -- cgit v1.2.3