gallium: more vertex count checks
authorAlan Hourihane <alanh@tungstengraphics.com>
Wed, 10 Dec 2008 12:02:24 +0000 (12:02 +0000)
committerAlan Hourihane <alanh@tungstengraphics.com>
Wed, 10 Dec 2008 12:02:24 +0000 (12:02 +0000)
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 9c73d9c735c8cd2d95f5595e9212c928ae2b8883..c4fc93ffbaef6f9863755ff97a1ccdfc729e213c 100644 (file)
@@ -165,8 +165,10 @@ void draw_pt_emit( struct pt_emit *emit,
     */
    draw_do_flush( draw, DRAW_FLUSH_BACKEND );
 
-   if (count > 65535) /* FIXME */
-      return FALSE;
+   if (vertex_count > 65535) { /* FIXME */
+      assert(0);
+      return;
+   }
 
    /* XXX: and work out some way to coordinate the render primitive
     * between vbuf.c and here...
@@ -229,6 +231,11 @@ void draw_pt_emit_linear(struct pt_emit *emit,
     */
    draw_do_flush( draw, DRAW_FLUSH_BACKEND );
 
+   if (count > 65535) { /* FIXME */
+      assert(0);
+      return;
+   }
+
    /* XXX: and work out some way to coordinate the render primitive
     * between vbuf.c and here...
     */
index 8ab08959e3be21728b03ee622264460d38b2a10f..5727b91c48c1868d991409afea9d7e6585c0d008 100644 (file)
@@ -229,6 +229,11 @@ static void fetch_emit_run( struct draw_pt_middle_end *middle,
     */
    draw_do_flush( draw, DRAW_FLUSH_BACKEND );
 
+   if (fetch_count > 65535) { /* FIXME */
+      assert(0);
+      return;
+   }
+
    hw_verts = draw->render->allocate_vertices( draw->render,
                                                (ushort)feme->translate->key.output_stride,
                                                (ushort)fetch_count );
@@ -283,6 +288,11 @@ static void fetch_emit_run_linear( struct draw_pt_middle_end *middle,
     */
    draw_do_flush( draw, DRAW_FLUSH_BACKEND );
 
+   if (count > 65535) { /* FIXME */
+      assert(0);
+      return;
+   }
+
    hw_verts = draw->render->allocate_vertices( draw->render,
                                                (ushort)feme->translate->key.output_stride,
                                                (ushort)count );
index 77e630c0992696a62c6a0b68eec61bb93ca064f7..69580f14723da7343655265abccec9d1266cfce4 100644 (file)
@@ -234,8 +234,10 @@ static void fse_run_linear( struct draw_pt_middle_end *middle,
     */
    draw_do_flush( draw, DRAW_FLUSH_BACKEND );
 
-   if (count > 65535) /* FIXME */
-      return FALSE;
+   if (count > 65535) { /* FIXME */
+      assert(0);
+      return;
+   }
 
    hw_verts = draw->render->allocate_vertices( draw->render,
                                                (ushort)fse->key.output_stride,
@@ -296,6 +298,11 @@ fse_run(struct draw_pt_middle_end *middle,
     */
    draw_do_flush( draw, DRAW_FLUSH_BACKEND );
 
+   if (fetch_count > 65535) { /* FIXME */
+      assert(0);
+      return;
+   }
+
    hw_verts = draw->render->allocate_vertices( draw->render,
                                                (ushort)fse->key.output_stride,
                                                (ushort)fetch_count );
@@ -350,6 +357,9 @@ static boolean fse_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)fse->key.output_stride,
                                                (ushort)count );