- VB->FirstPrimitive = 0;
- VB->Primitive[0] = mode | PRIM_BEGIN | PRIM_END | PRIM_LAST;
- VB->PrimitiveLength[0] = nr + minimum;
- tnl->pipeline.run_input_changes |= ctx->Array._Enabled;
+ tnl->vb.Primitive = &prim;
+ tnl->vb.Primitive[0].mode = mode;
+
+ if (j == start + minimum)
+ tnl->vb.Primitive[0].mode |= PRIM_BEGIN;
+
+ if (j + nr + skip >= count)
+ tnl->vb.Primitive[0].mode |= PRIM_END;
+
+ tnl->vb.Primitive[0].start = 0;
+ tnl->vb.Primitive[0].count = nr + minimum;
+ tnl->vb.PrimitiveCount = 1;
+
+ /* 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;