/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.0
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
if (tnl->pipeline.build_state_changes)
_tnl_validate_pipeline( ctx );
+ /* XXX is "end" correct? Looking at the implementation of
+ * _tnl_vb_bind_arrays(), perhaps we should pass end-start.
+ */
_tnl_vb_bind_arrays( ctx, start, end );
tnl->vb.Primitive = &prim;
fallback_drawarrays( ctx, mode, start, start + count );
}
else if (ctx->Array.LockCount &&
- count < (GLint) ctx->Const.MaxArrayLockSize) {
+ count <= (GLint) ctx->Const.MaxArrayLockSize) {
struct tnl_prim prim;
* must use the slow path if they cannot fit in a single
* vertex buffer.
*/
- if (count < (GLint) ctx->Const.MaxArrayLockSize) {
+ if (count <= (GLint) ctx->Const.MaxArrayLockSize) {
bufsz = ctx->Const.MaxArrayLockSize;
minimum = 0;
modulo = 1;
nr = MIN2( bufsz, count - j );
+ /* XXX is the last parameter a count or index into the array??? */
_tnl_vb_bind_arrays( ctx, j - minimum, j + nr );
tnl->vb.Primitive = &prim;
"elements outside locked range.");
}
}
- else if (end + 1 - start < ctx->Const.MaxArrayLockSize) {
+ else if (end - start + 1 <= ctx->Const.MaxArrayLockSize) {
/* The arrays aren't locked but we can still fit them inside a
* single vertexbuffer.
*/
_tnl_draw_range_elements( ctx, mode, start, end + 1, count, ui_indices );
- } else {
+ }
+ else {
/* Range is too big to optimize:
*/
fallback_drawelements( ctx, mode, count, ui_indices );
if (ui_indices[i] > max_elt)
max_elt = ui_indices[i];
+ /* XXX should this < really be <= ??? */
if (max_elt < ctx->Const.MaxArrayLockSize && /* can we use it? */
max_elt < (GLuint) count) /* do we want to use it? */
_tnl_draw_range_elements( ctx, mode, 0, max_elt+1, count, ui_indices );
/*
* Mesa 3-D graphics library
- * Version: 5.1
+ * Version: 6.0
*
- * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
-
-
-
+/*
+ * XXX Is count correct? From some of the callers, it appears that
+ * this should perhaps be an "end" index, ala the "start" index.
+ */
void _tnl_vb_bind_arrays( GLcontext *ctx, GLint start, GLsizei count )
{
TNLcontext *tnl = TNL_CONTEXT(ctx);