From e90de7883a3bd9afd27ac83314f08cf9f03f60e3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 29 Nov 2003 19:33:33 +0000 Subject: Fix generic/conventional vertex array glitches. Changed _NEW_ARRAY_ATTRIB_0 back to 0x10000 so that the conventional and generic enable bits do not alias. In ac_import.c test Array.Normal.Enabled instead of Array._Enabled & _NEW_ARRAY_COLOR0, etc. In t_array_import.c give priority for generic arrays over conventional arrays on an individual basis, not all or none. --- src/mesa/tnl/t_array_api.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'src/mesa/tnl/t_array_api.c') diff --git a/src/mesa/tnl/t_array_api.c b/src/mesa/tnl/t_array_api.c index f9f5fe9951..2b10a9d1c2 100644 --- a/src/mesa/tnl/t_array_api.c +++ b/src/mesa/tnl/t_array_api.c @@ -107,11 +107,16 @@ static void _tnl_draw_range_elements( GLcontext *ctx, GLenum mode, if (ctx->Array.LockCount) tnl->Driver.RunPipeline( ctx ); else { + /* The lower 16 bits represent the conventional arrays while the + * upper 16 bits represent the generic arrays. OR those bits + * together to indicate which vertex attribs are in effect. + */ + GLuint enabledArrays = ctx->Array._Enabled | (ctx->Array._Enabled >> 16); /* Note that arrays may have changed before/after execution. */ - tnl->pipeline.run_input_changes |= ctx->Array._Enabled; + tnl->pipeline.run_input_changes |= enabledArrays; tnl->Driver.RunPipeline( ctx ); - tnl->pipeline.run_input_changes |= ctx->Array._Enabled; + tnl->pipeline.run_input_changes |= enabledArrays; } if (start) @@ -130,6 +135,7 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count) GET_CURRENT_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); GLuint thresh = (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES) ? 30 : 10; + GLuint enabledArrays; if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(NULL, "_tnl_DrawArrays %d %d\n", start, count); @@ -267,9 +273,16 @@ _tnl_DrawArrays(GLenum mode, GLint start, GLsizei count) tnl->vb.Primitive[0].count = nr + minimum; tnl->vb.PrimitiveCount = 1; - tnl->pipeline.run_input_changes |= ctx->Array._Enabled; + /* The lower 16 bits represent the conventional arrays while the + * upper 16 bits represent the generic arrays. OR those bits + * together to indicate which vertex attribs are in effect. + */ + enabledArrays = ctx->Array._Enabled | (ctx->Array._Enabled >> 16); + /* Note that arrays may have changed before/after execution. + */ + tnl->pipeline.run_input_changes |= enabledArrays; tnl->Driver.RunPipeline( ctx ); - tnl->pipeline.run_input_changes |= ctx->Array._Enabled; + tnl->pipeline.run_input_changes |= enabledArrays; } } } -- cgit v1.2.3