summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-02-11 16:35:12 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-02-11 16:48:34 +0000
commit874f364e9ea3a03d29ae4b6e1c7e2843ef8b9e79 (patch)
treebb031618c4dde2b1e51dcf1b080e965d0ca08c68 /src
parentb6ad7c8c4a19241146e92e3765cd2095dcd80547 (diff)
draw: Cap max vertices instead of failing assert.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_vbuf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
index 5ead25efff..9153bc2f86 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);