From: José Fonseca Date: Wed, 11 Feb 2009 16:35:12 +0000 (+0000) Subject: draw: Cap max vertices instead of failing assert. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=874f364e9ea3a03d29ae4b6e1c7e2843ef8b9e79;p=mesa.git draw: Cap max vertices instead of failing assert. --- diff --git a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c index 5ead25efff0..9153bc2f865 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c +++ b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c @@ -394,13 +394,14 @@ vbuf_alloc_vertices( struct vbuf_stage *vbuf ) /* even number */ vbuf->max_vertices = vbuf->max_vertices & ~1; + if(vbuf->max_vertices >= UNDEFINED_VERTEX_ID) + vbuf->max_vertices = UNDEFINED_VERTEX_ID - 1; + /* Must always succeed -- driver gives us a * 'max_vertex_buffer_bytes' which it guarantees it can allocate, * and it will flush itself if necessary to do so. If this does * fail, we are basically without usable hardware. */ - assert(vbuf->max_vertices < UNDEFINED_VERTEX_ID); - vbuf->vertices = (uint *) vbuf->render->allocate_vertices(vbuf->render, (ushort) vbuf->vertex_size, (ushort) vbuf->max_vertices);