From ef6313ffd3c0e764142ed2df87b52264bd7d4188 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 22 Nov 2017 09:45:28 -0500 Subject: [PATCH] freedreno/a5xx: correct max_indicies for indirect draws Signed-off-by: Rob Clark --- src/gallium/drivers/freedreno/a5xx/fd5_draw.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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, -- 2.30.2