struct r600_draw draw;
int r;
- assert(info->index_bias == 0);
-
memset(&draw, 0, sizeof(draw));
if (rctx->any_user_vbs) {
draw.start += rctx->index_buffer.offset / rctx->index_buffer.index_size;
draw.min_index = info->min_index;
draw.max_index = info->max_index;
+ draw.index_bias = info->index_bias;
r600_translate_index_buffer(rctx, &rctx->index_buffer.buffer,
&rctx->index_buffer.index_size,
- rctx->index_buffer.offset, &draw.start,
+ 0, &draw.start,
info->count);
draw.index_size = rctx->index_buffer.index_size;
draw.index_buffer = rctx->index_buffer.buffer;
- draw.index_buffer_offset = rctx->index_buffer.offset;
-
+ draw.index_buffer_offset = draw.start * draw.index_size;
+ draw.start = 0;
r600_upload_index_buffer(rctx, &draw);
}
else {
draw.min_index = 0;
draw.max_index = 0xffffff;
draw.index_buffer_offset = 0;
+ draw.index_bias = draw.start;
}
+
r = r600_draw_common(&draw);
if (r)
fprintf(stderr,"draw common failed %d\n", r);
draw->vgt.states[R600_VGT__VGT_PRIMITIVE_TYPE] = prim;
draw->vgt.states[R600_VGT__VGT_MAX_VTX_INDX] = draw->max_index;
draw->vgt.states[R600_VGT__VGT_MIN_VTX_INDX] = draw->min_index;
- draw->vgt.states[R600_VGT__VGT_INDX_OFFSET] = draw->start;
+ draw->vgt.states[R600_VGT__VGT_INDX_OFFSET] = draw->index_bias;
draw->vgt.states[R600_VGT__VGT_MULTI_PRIM_IB_RESET_INDX] = 0x00000000;
draw->vgt.states[R600_VGT__VGT_DMA_INDEX_TYPE] = vgt_dma_index_type;
draw->vgt.states[R600_VGT__VGT_PRIMITIVEID_EN] = 0x00000000;