freedreno: fix index buffer offset
authorRob Clark <robclark@freedesktop.org>
Sat, 17 May 2014 17:50:10 +0000 (13:50 -0400)
committerRob Clark <robclark@freedesktop.org>
Sun, 18 May 2014 19:22:25 +0000 (15:22 -0400)
Signed-off-by: Rob Clark <robclark@freedesktop.org>
src/gallium/drivers/freedreno/freedreno_draw.c

index 1289bb4b8f2a71cadf0356330375a21c6bb4f85f..e3c8cc8e5a0c89b79ca64a06599fcffd5b2a7dcd 100644 (file)
@@ -71,7 +71,7 @@ fd_draw_emit(struct fd_context *ctx, struct fd_ringbuffer *ring,
                idx_bo = fd_resource(idx->buffer)->bo;
                idx_type = size2indextype(idx->index_size);
                idx_size = idx->index_size * info->count;
-               idx_offset = idx->offset;
+               idx_offset = idx->offset + (info->start * idx->index_size);
                src_sel = DI_SRC_SEL_DMA;
        } else {
                idx_bo = NULL;