llvmpipe: added assertions
authorBrian Paul <brianp@vmware.com>
Tue, 1 Dec 2009 23:24:57 +0000 (16:24 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 1 Dec 2009 23:25:00 +0000 (16:25 -0700)
And remove unused BLOCKSIZE.

src/gallium/drivers/llvmpipe/lp_rast_tri.c

index f6cb628ed4b55b6040b4d17fca6354453b4a4dc0..e772a0158a6026d4a25180df7d38bdb34cfdf868 100644 (file)
@@ -34,9 +34,6 @@
 #include "lp_tile_soa.h"
 
 
-#define BLOCKSIZE 4
-
-
 /**
  * Add a 4x4 block of pixels to the block list.
  * All pixels are known to be inside the triangle's bounds.
@@ -186,6 +183,8 @@ lp_rast_triangle( struct lp_rasterizer *rast,
    int eo2 = tri->eo2 * 16;
    int eo3 = tri->eo3 * 16;
 
+   assert(Elements(rast->blocks) == (TILE_SIZE * TILE_SIZE) / (4*4));
+
    debug_printf("%s\n", __FUNCTION__);
 
    rast->nr_blocks = 0;
@@ -218,6 +217,8 @@ lp_rast_triangle( struct lp_rasterizer *rast,
       }
    }
 
+   assert(rast->nr_blocks <= Elements(rast->blocks));
+
    /* Shade the 4x4 pixel blocks */
    for (i = 0; i < rast->nr_blocks; i++) 
       lp_rast_shade_quads(rast, &tri->inputs,