gallium: temporary check for > 65535 vertices
authorAlan Hourihane <alanh@tungstengraphics.com>
Wed, 10 Dec 2008 11:30:46 +0000 (11:30 +0000)
committerAlan Hourihane <alanh@tungstengraphics.com>
Wed, 10 Dec 2008 11:30:46 +0000 (11:30 +0000)
src/gallium/auxiliary/draw/draw_pipe_vbuf.c
src/gallium/auxiliary/draw/draw_pt_emit.c
src/gallium/auxiliary/draw/draw_pt_fetch_emit.c
src/gallium/auxiliary/draw/draw_pt_fetch_shade_emit.c

index 9825e116c32d8f4ac9bd525b0da198da405853f8..fb0d895084197e1d8c1afdb5d423a09c401e349c 100644 (file)
@@ -399,6 +399,8 @@ vbuf_alloc_vertices( struct vbuf_stage *vbuf )
     * and it will flush itself if necessary to do so.  If this does
     * fail, we are basically without usable hardware.
     */
+   assert(vbuf->max_vertices < 65536);
+
    vbuf->vertices = (uint *) vbuf->render->allocate_vertices(vbuf->render,
                                                             (ushort) vbuf->vertex_size,
                                                             (ushort) vbuf->max_vertices);
index d520b05869b6f7ccd8de53d998615c70ade3fc09..9c73d9c735c8cd2d95f5595e9212c928ae2b8883 100644 (file)
@@ -165,6 +165,9 @@ void draw_pt_emit( struct pt_emit *emit,
     */
    draw_do_flush( draw, DRAW_FLUSH_BACKEND );
 
+   if (count > 65535) /* FIXME */
+      return FALSE;
+
    /* XXX: and work out some way to coordinate the render primitive
     * between vbuf.c and here...
     */
index 3966ad48ba7da9762b394c08c469e1db531cde01..8ab08959e3be21728b03ee622264460d38b2a10f 100644 (file)
@@ -338,6 +338,9 @@ static boolean fetch_emit_run_linear_elts( struct draw_pt_middle_end *middle,
     */
    draw_do_flush( draw, DRAW_FLUSH_BACKEND );
 
+   if (count > 65535) /* FIXME */
+      return FALSE;
+
    hw_verts = draw->render->allocate_vertices( draw->render,
                                                (ushort)feme->translate->key.output_stride,
                                                (ushort)count );
index f7e6a1a8eebb4485ad0fceb76ccecda292cae9ec..77e630c0992696a62c6a0b68eec61bb93ca064f7 100644 (file)
@@ -234,6 +234,9 @@ static void fse_run_linear( struct draw_pt_middle_end *middle,
     */
    draw_do_flush( draw, DRAW_FLUSH_BACKEND );
 
+   if (count > 65535) /* FIXME */
+      return FALSE;
+
    hw_verts = draw->render->allocate_vertices( draw->render,
                                                (ushort)fse->key.output_stride,
                                                (ushort)count );