+ draw_print_arrays(draw, info->mode, info->start, MIN2(count, 20));
+
+ index_limit = util_draw_max_index(draw->pt.vertex_buffer,
+ draw->pt.vertex_element,
+ draw->pt.nr_vertex_elements,
+ info);
+#if HAVE_LLVM
+ if (!draw->llvm)
+#endif
+ {
+ if (index_limit == 0) {
+ /* one of the buffers is too small to do any valid drawing */
+ debug_warning("draw: VBO too small to draw anything\n");
+ return;
+ }
+ }
+
+ /* If we're collecting stats then make sure we start from scratch */
+ if (draw->collect_statistics) {
+ memset(&draw->statistics, 0, sizeof(draw->statistics));
+ }
+
+ draw->pt.max_index = index_limit - 1;
+
+ /*
+ * TODO: We could use draw->pt.max_index to further narrow
+ * the min_index/max_index hints given by the state tracker.
+ */
+
+ for (instance = 0; instance < info->instance_count; instance++) {
+ draw->instance_id = instance + info->start_instance;
+ draw->start_instance = info->start_instance;
+ /* check for overflow */
+ if (draw->instance_id < instance ||
+ draw->instance_id < info->start_instance) {
+ /* if we overflown just set the instance id to the max */
+ draw->instance_id = 0xffffffff;
+ }
+
+ draw_new_instance(draw);
+
+ if (info->primitive_restart) {
+ draw_pt_arrays_restart(draw, info);
+ }
+ else {
+ draw_pt_arrays(draw, info->mode, info->start, count);
+ }
+ }