From 2a30d3d74a0b87f8066659952628ccd072a4e2b0 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 26 Apr 2010 14:55:16 +0100 Subject: draw: Pass-through pipe_buffer::max_index to translate. max_index must be observed to prevent crashes due to bad index data. I've been using this patch for some time without regressions. Some places, where we use internal vertex buffer, it is not entirely clear what max_index should be, so passing just ~0 to avoid regressions for now. --- src/gallium/auxiliary/draw/draw_pt_fetch.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/gallium/auxiliary/draw/draw_pt_fetch.c') diff --git a/src/gallium/auxiliary/draw/draw_pt_fetch.c b/src/gallium/auxiliary/draw/draw_pt_fetch.c index 252be5053e..a1347221b5 100644 --- a/src/gallium/auxiliary/draw/draw_pt_fetch.c +++ b/src/gallium/auxiliary/draw/draw_pt_fetch.c @@ -149,7 +149,8 @@ void draw_pt_fetch_prepare( struct pt_fetch *fetch, fetch->translate->set_buffer(fetch->translate, draw->pt.nr_vertex_buffers, &vh, - 0); + 0, + ~0); } } @@ -172,7 +173,8 @@ void draw_pt_fetch_run( struct pt_fetch *fetch, i, ((char *)draw->pt.user.vbuffer[i] + draw->pt.vertex_buffer[i].buffer_offset), - draw->pt.vertex_buffer[i].stride ); + draw->pt.vertex_buffer[i].stride, + draw->pt.vertex_buffer[i].max_index); } translate->run_elts( translate, @@ -198,7 +200,8 @@ void draw_pt_fetch_run_linear( struct pt_fetch *fetch, i, ((char *)draw->pt.user.vbuffer[i] + draw->pt.vertex_buffer[i].buffer_offset), - draw->pt.vertex_buffer[i].stride ); + draw->pt.vertex_buffer[i].stride, + draw->pt.vertex_buffer[i].max_index); } translate->run( translate, -- cgit v1.2.3