diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2004-01-12 23:21:54 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2004-01-12 23:21:54 +0000 |
commit | 8bec7c09bbe3a22109f97312ca2cc4e46da282a1 (patch) | |
tree | f56180c94f76ad27c98d9071e3a4e80e076e9133 /src/mesa/tnl | |
parent | 553a8e0e7b0e8ec2f208a582c6e644cd340dba53 (diff) |
Don't call _tnl_draw_range_elements() unless start == 0.
Diffstat (limited to 'src/mesa/tnl')
-rw-r--r-- | src/mesa/tnl/t_array_api.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mesa/tnl/t_array_api.c b/src/mesa/tnl/t_array_api.c index 4322419eff..818a15b6b8 100644 --- a/src/mesa/tnl/t_array_api.c +++ b/src/mesa/tnl/t_array_api.c @@ -103,9 +103,13 @@ static void _tnl_draw_range_elements( GLcontext *ctx, GLenum mode, tnl->vb.Elts = (GLuint *)indices; + assert (start == 0); + +/* XXX - indices may be read only if (start) for (i = 0 ; i < count ; i++) indices[i] -= start; +*/ if (ctx->Array.LockCount) tnl->Driver.RunPipeline( ctx ); @@ -122,9 +126,11 @@ static void _tnl_draw_range_elements( GLcontext *ctx, GLenum mode, tnl->pipeline.run_input_changes |= enabledArrays; } +/* XXX - indices may be read only if (start) for (i = 0 ; i < count ; i++) indices[i] += start; +*/ } @@ -335,7 +341,8 @@ _tnl_DrawRangeElements(GLenum mode, /* Are the arrays already locked? If so we currently have to look * at the whole locked range. */ - if (start >= ctx->Array.LockFirst && end <= ctx->Array.LockCount) + if (start == 0 && + start >= ctx->Array.LockFirst && end <= ctx->Array.LockCount) _tnl_draw_range_elements( ctx, mode, ctx->Array.LockFirst, ctx->Array.LockCount, @@ -356,7 +363,8 @@ _tnl_DrawRangeElements(GLenum mode, "elements outside locked range."); } } - else if (end - start + 1 <= ctx->Const.MaxArrayLockSize) { + else if (start == 0 && + end - start + 1 <= ctx->Const.MaxArrayLockSize) { /* The arrays aren't locked but we can still fit them inside a * single vertexbuffer. */ @@ -400,7 +408,8 @@ _tnl_DrawElements(GLenum mode, GLsizei count, GLenum type, assert(!ctx->CompileFlag); - if (ctx->Array.LockCount) { + if (ctx->Array.LockFirst == 0 && + ctx->Array.LockCount) { _tnl_draw_range_elements( ctx, mode, ctx->Array.LockFirst, ctx->Array.LockCount, |