summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2008-06-02 12:59:16 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2008-06-04 11:25:54 +0100
commit0a4aea0e86a897d9afb9f2a0ec27f03faf8f1b21 (patch)
tree9873d3bcf68cf71e2e5abc7b60f911ad73cc5f90 /src/gallium/auxiliary/draw/draw_pipe_vbuf.c
parentc218b8c6c6593f434a749bf67ad976007e6eef61 (diff)
draw: respect driver's max vertex buffer size
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_pipe_vbuf.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_pipe_vbuf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
index d514e28b77..9e5597c32c 100644
--- a/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
+++ b/src/gallium/auxiliary/draw/draw_pipe_vbuf.c
@@ -387,6 +387,12 @@ vbuf_alloc_vertices( struct vbuf_stage *vbuf )
/* Allocate a new vertex buffer */
vbuf->max_vertices = vbuf->render->max_vertex_buffer_bytes / vbuf->vertex_size;
+
+ /* 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.
+ */
vbuf->vertices = (uint *) vbuf->render->allocate_vertices(vbuf->render,
(ushort) vbuf->vertex_size,
(ushort) vbuf->max_vertices);