From b1a98a1107ad70b1a6864dd38f33beebe689fec7 Mon Sep 17 00:00:00 2001 From: "Kristian H. Kristensen" Date: Tue, 16 Jun 2020 11:39:07 -0700 Subject: [PATCH] freedreno/a6xx: Set index buffer size to bo size The number of vertices may be out of bound and if we use it for computing index buffer size we may get too big a size. Part-of: --- src/gallium/drivers/freedreno/a6xx/fd6_draw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c index 0279b2ee872..f8b87b76f13 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_draw.c +++ b/src/gallium/drivers/freedreno/a6xx/fd6_draw.c @@ -82,7 +82,7 @@ draw_emit(struct fd_ringbuffer *ring, assert(!info->has_user_indices); struct pipe_resource *idx_buffer = info->index.resource; - uint32_t idx_size = info->index_size * info->count; + uint32_t idx_size = idx_buffer->width0 - index_offset; uint32_t idx_offset = index_offset + info->start * info->index_size; OUT_PKT(ring, CP_DRAW_INDX_OFFSET, -- 2.30.2