-/* $Id: t_array_api.c,v 1.16 2001/08/02 19:58:07 keithw Exp $ */
+/* $Id: t_array_api.c,v 1.17 2001/08/02 21:30:10 keithw Exp $ */
/*
* Mesa 3-D graphics library
* operations: producing the flag array and computing the orflag
* of the flag array.
*/
-#if 1
+#if 0
+ /* Buggy - see sgl testGeoSets.exe polygon mode
+ */
if (_tnl_hard_begin( ctx, mode )) {
GLint i;
for (i = 0 ; i < count ; ) {
{
/* fprintf(stderr, "%s\n", __FUNCTION__); */
-#if 1
+#if 0
/* Optimized code that fakes the effect of calling
* _tnl_array_element for each index in the list.
+ *
+ * Possibly buggy, see above.
*/
if (_tnl_hard_begin( ctx, mode )) {
GLint i, j;
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
-/* fprintf(stderr, "%s\n", __FUNCTION__); */
+/* fprintf(stderr, "%s %d %d\n", __FUNCTION__, start, count); */
/* Check arguments, etc.
*/
_tnl_validate_pipeline( ctx );
if (ctx->CompileFlag) {
- fallback_drawarrays( ctx, mode, start, count );
+ fallback_drawarrays( ctx, mode, start, start + count );
}
- else if (count - start < (GLint) ctx->Const.MaxArrayLockSize) {
+ else if (count < (GLint) ctx->Const.MaxArrayLockSize) {
/* Small primitives which can fit in a single vertex buffer:
*/
{
if (start < (GLint) ctx->Array.LockFirst)
start = ctx->Array.LockFirst;
- if (count > (GLint) ctx->Array.LockCount)
- count = ctx->Array.LockCount;
+ if (start + count > (GLint) ctx->Array.LockCount)
+ count = ctx->Array.LockCount - start;
if (start >= count)
return;
_tnl_vb_bind_arrays( ctx, ctx->Array.LockFirst, ctx->Array.LockCount );
VB->FirstPrimitive = start;
VB->Primitive[start] = mode | PRIM_BEGIN | PRIM_END | PRIM_LAST;
- VB->PrimitiveLength[start] = count - start;
+ VB->PrimitiveLength[start] = count;
tnl->Driver.RunPipeline( ctx );
} else {
/* The arrays are small enough to fit in a single VB; just bind
*
* Invalidate any cached data dependent on these arrays.
*/
- _tnl_vb_bind_arrays( ctx, start, count );
+ _tnl_vb_bind_arrays( ctx, start, start + count );
VB->FirstPrimitive = 0;
VB->Primitive[0] = mode | PRIM_BEGIN | PRIM_END | PRIM_LAST;
- VB->PrimitiveLength[0] = count - start;
+ VB->PrimitiveLength[0] = count;
tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
tnl->Driver.RunPipeline( ctx );
tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
/* Primitives requiring a copied vertex (fan-like primitives)
* must use the slow path:
*/
- fallback_drawarrays( ctx, mode, start, count );
+ fallback_drawarrays( ctx, mode, start, start + count );
return;
}
bufsz -= bufsz % modulo;
bufsz -= minimum;
+ count += start;
for (j = start + minimum ; j < count ; j += nr + skip ) {
GET_CURRENT_CONTEXT(ctx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint *ui_indices;
+
+/* fprintf(stderr, "%s\n", __FUNCTION__); */
/* Check arguments, etc.
*/