summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/freedreno/a5xx/fd5_draw.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_draw.h b/src/gallium/drivers/freedreno/a5xx/fd5_draw.h
index d1069157e75..3edfc391fdf 100644
--- a/src/gallium/drivers/freedreno/a5xx/fd5_draw.h
+++ b/src/gallium/drivers/freedreno/a5xx/fd5_draw.h
@@ -97,7 +97,8 @@ fd5_draw_emit(struct fd_batch *batch, struct fd_ringbuffer *ring,
if (info->index_size) {
struct pipe_resource *idx = info->index.resource;
- unsigned max_indicies = idx->width0 / info->index_size;
+ unsigned max_indicies = (idx->width0 - info->indirect->offset) /
+ info->index_size;
OUT_PKT7(ring, CP_DRAW_INDX_INDIRECT, 6);
OUT_RINGP(ring, DRAW4(primtype, DI_SRC_SEL_DMA,