vcache->fetch_max,
draw_count);
- if (max_index >= DRAW_PIPE_MAX_VERTICES ||
+ if (elt_bias + max_index >= DRAW_PIPE_MAX_VERTICES ||
fetch_count >= UNDEFINED_VERTEX_ID ||
fetch_count > draw_count) {
if (0) debug_printf("fail\n");
}
+ assert((elt_bias >= 0 && min_index + elt_bias >= min_index) ||
+ (elt_bias < 0 && min_index + elt_bias < min_index));
+
if (elt_bias <= 0 &&
min_index == (unsigned)-elt_bias &&
index_size == 2)
case 1:
rebase_ubyte_elts( (const ubyte *)elts,
draw_count,
- elt_bias - (int)min_index,
+ -elt_bias - (int)min_index,
storage );
break;
case 2:
rebase_ushort_elts( (const ushort *)elts,
draw_count,
- elt_bias - (int)min_index,
+ -elt_bias - (int)min_index,
storage );
break;
case 4:
rebase_uint_elts( (const uint *)elts,
draw_count,
- elt_bias - (int)min_index,
+ -elt_bias - (int)min_index,
storage );
break;
if (fetch_count < UNDEFINED_VERTEX_ID)
ok = vcache->middle->run_linear_elts( vcache->middle,
- min_index, /* start */
+ min_index + elt_bias, /* start */
fetch_count,
transformed_elts,
draw_count );