summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2013-05-13 23:07:14 -0400
committerZack Rusin <[email protected]>2013-05-14 03:10:56 -0400
commit5104ed3dbf18d47736fc67a8e3e317ea18360fa8 (patch)
treed161f1e6f09b3ab6846b064105b8cfc014b203cc /src/gallium/drivers/svga
parentd5250da8189d0fb9741049cdbfc50e84aab44ecb (diff)
draw: try to prevent overflows on index buffers
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 <[email protected]> Reviewed-by: José Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga')
-rw-r--r--src/gallium/drivers/svga/svga_swtnl_draw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/svga/svga_swtnl_draw.c b/src/gallium/drivers/svga/svga_swtnl_draw.c
index 850575c14b9..0a049569ff7 100644
--- a/src/gallium/drivers/svga/svga_swtnl_draw.c
+++ b/src/gallium/drivers/svga/svga_swtnl_draw.c
@@ -84,7 +84,7 @@ svga_swtnl_draw_vbo(struct svga_context *svga,
&ib_transfer);
draw_set_indexes(draw,
(const ubyte *) map + svga->curr.ib.offset,
- svga->curr.ib.index_size);
+ svga->curr.ib.index_size, ~0);
}
if (svga->curr.cb[PIPE_SHADER_VERTEX]) {
@@ -118,7 +118,7 @@ svga_swtnl_draw_vbo(struct svga_context *svga,
if (ib_transfer) {
pipe_buffer_unmap(&svga->pipe, ib_transfer);
- draw_set_indexes(draw, NULL, 0);
+ draw_set_indexes(draw, NULL, 0, 0);
}
if (svga->curr.cb[PIPE_SHADER_VERTEX]) {