aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorKristian H. Kristensen <[email protected]>2020-06-16 11:39:07 -0700
committerMarge Bot <[email protected]>2020-06-19 19:25:34 +0000
commitb1a98a1107ad70b1a6864dd38f33beebe689fec7 (patch)
treea84cb175be9c9717c4e2c748d93f437f212d649d /src/gallium/drivers
parent2580e4f921036bd63aa74d8343d1e05818ecf6cd (diff)
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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5552>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/freedreno/a6xx/fd6_draw.c2
1 files changed, 1 insertions, 1 deletions
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,