+static void fallback_drawelements( GLcontext *ctx, GLenum mode, GLsizei count,
+ const GLuint *indices)
+{
+ GLint i;
+
+ assert(!ctx->CompileFlag);
+ assert(ctx->Driver.CurrentExecPrimitive == GL_POLYGON+1);
+
+ /* Here, indices will already reflect the buffer object if active */
+
+ GL_CALL(Begin)(mode);
+ for (i = 0 ; i < count ; i++) {
+ GL_CALL(ArrayElement)( indices[i] );
+ }
+ GL_CALL(End)();
+}
+
+
+/* Note this function no longer takes a 'start' value, the range is
+ * assumed to start at zero. The old trick of subtracting 'start'
+ * from each index won't work if the indices are not in writeable
+ * memory.
+ */
+static void _tnl_draw_range_elements( GLcontext *ctx, GLenum mode,
+ GLuint max_index,
+ GLsizei index_count, GLuint *indices )
+
+{
+ TNLcontext *tnl = TNL_CONTEXT(ctx);
+ struct tnl_prim prim;
+ FLUSH_CURRENT( ctx, 0 );
+
+ if (tnl->pipeline.build_state_changes)
+ _tnl_validate_pipeline( ctx );
+
+ _tnl_vb_bind_arrays( ctx, 0, max_index );
+
+ tnl->vb.Primitive = &prim;
+ tnl->vb.Primitive[0].mode = mode | PRIM_BEGIN | PRIM_END;
+ tnl->vb.Primitive[0].start = 0;
+ tnl->vb.Primitive[0].count = index_count;
+ tnl->vb.PrimitiveCount = 1;
+
+ tnl->vb.Elts = (GLuint *)indices;
+
+ 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 |= enabledArrays & 0xffff;
+ tnl->Driver.RunPipeline( ctx );
+ tnl->pipeline.run_input_changes |= enabledArrays & 0xffff;
+ }
+}
+
+
+
+/**
+ * Called via the GL API dispatcher.
+ */
+void GLAPIENTRY