From: Kristian H. Kristensen Date: Tue, 16 Jun 2020 18:39:07 +0000 (-0700) Subject: freedreno/a6xx: Set index buffer size to bo size X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b1a98a1107ad70b1a6864dd38f33beebe689fec7;p=mesa.git 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: --- 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,