softpipe: Preserve/check the signal of the number of scanlines in an edge.
authorJosé Fonseca <jfonseca@vmware.com>
Sun, 18 Apr 2010 07:48:55 +0000 (09:48 +0200)
committerJosé Fonseca <jfonseca@vmware.com>
Sun, 18 Apr 2010 08:36:28 +0000 (10:36 +0200)
It can become negative in some weird triangles.

src/gallium/drivers/softpipe/sp_setup.c

index 85966bc5e4902d8b00782ee184162d7ee21e9890..e136cb7cf739cc4c563fc97031e6fae3dbd60116 100644 (file)
@@ -691,7 +691,7 @@ static void setup_tri_edges( struct setup_context *setup )
 static void subtriangle( struct setup_context *setup,
                         struct edge *eleft,
                         struct edge *eright,
-                        unsigned lines )
+                        int lines )
 {
    const struct pipe_scissor_state *cliprect = &setup->softpipe->cliprect;
    const int minx = (int) cliprect->minx;
@@ -702,6 +702,7 @@ static void subtriangle( struct setup_context *setup,
    int sy = (int)eleft->sy;
 
    assert((int)eleft->sy == (int) eright->sy);
+   assert(lines >= 0);
 
    /* clip top/bottom */
    start_y = sy;