diff options
author | Brian Paul <[email protected]> | 2003-11-29 19:33:33 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2003-11-29 19:33:33 +0000 |
commit | e90de7883a3bd9afd27ac83314f08cf9f03f60e3 (patch) | |
tree | bcbdd5ba61e8f1b93d3a2466ac0e7be85a35024c /src/mesa/tnl/t_array_api.c | |
parent | afb6fe034c3df9377ca8c0393a60c7996af92faf (diff) |
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.
Diffstat (limited to 'src/mesa/tnl/t_array_api.c')
-rw-r--r-- | src/mesa/tnl/t_array_api.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/src/mesa/tnl/t_array_api.c b/src/mesa/tnl/t_array_api.c index f9f5fe99511..2b10a9d1c2c 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; } } } |