From 5104ed3dbf18d47736fc67a8e3e317ea18360fa8 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 13 May 2013 23:07:14 -0400 Subject: draw: try to prevent overflows on index buffers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Pass in the size of the index buffer, when available, and use it to handle out of bounds conditions. The behavior in the case of an overflow needs to be the same as with other overflows in the vertex processing pipeline meaning that a vertex should still be generated but all attributes in it set to zero. Signed-off-by: Zack Rusin Reviewed-by: José Fonseca Reviewed-by: Roland Scheidegger --- src/gallium/drivers/nv30/nv30_draw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gallium/drivers/nv30') diff --git a/src/gallium/drivers/nv30/nv30_draw.c b/src/gallium/drivers/nv30/nv30_draw.c index 92185c922c2..e0a1628eb91 100644 --- a/src/gallium/drivers/nv30/nv30_draw.c +++ b/src/gallium/drivers/nv30/nv30_draw.c @@ -423,9 +423,9 @@ nv30_render_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) PIPE_TRANSFER_READ, &transferi); draw_set_indexes(draw, (ubyte *) map + nv30->idxbuf.offset, - nv30->idxbuf.index_size); + nv30->idxbuf.index_size, ~0); } else { - draw_set_indexes(draw, NULL, 0); + draw_set_indexes(draw, NULL, 0, 0); } draw_vbo(draw, info); -- cgit v1.2.3