diff options
author | Keith Whitwell <keithw@vmware.com> | 2009-10-20 09:44:23 +0100 |
---|---|---|
committer | Keith Whitwell <keithw@vmware.com> | 2009-10-20 09:44:23 +0100 |
commit | 3199c6e764c20c69a76c561b9f4b89a23e5a97f5 (patch) | |
tree | 9c47f8a2d2c0b30a47c8eefba88501a05ed7a0d1 /src/gallium | |
parent | 8d752a20c6f70b442ac2210cce0fd001499be5f6 (diff) | |
download | external_mesa3d-3199c6e764c20c69a76c561b9f4b89a23e5a97f5.zip external_mesa3d-3199c6e764c20c69a76c561b9f4b89a23e5a97f5.tar.gz external_mesa3d-3199c6e764c20c69a76c561b9f4b89a23e5a97f5.tar.bz2 |
llvmpipe: move block list into rast struct
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_rast_priv.h | 7 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_rast_tri.c | 35 |
2 files changed, 22 insertions, 20 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast_priv.h b/src/gallium/drivers/llvmpipe/lp_rast_priv.h index 2333729..323c046 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_priv.h +++ b/src/gallium/drivers/llvmpipe/lp_rast_priv.h @@ -74,6 +74,13 @@ struct lp_rasterizer { unsigned clear_depth; char clear_stencil; } state; + + int nr_blocks; + struct { + unsigned x; + unsigned y; + unsigned mask; + } blocks[256]; }; diff --git a/src/gallium/drivers/llvmpipe/lp_rast_tri.c b/src/gallium/drivers/llvmpipe/lp_rast_tri.c index 12ac840..174e6ab 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast_tri.c +++ b/src/gallium/drivers/llvmpipe/lp_rast_tri.c @@ -36,22 +36,17 @@ #define BLOCKSIZE 4 -static struct { - int x; - int y; - unsigned mask; -} blocks[256]; -static int nr_blocks; /* Render a 4x4 unmasked block: */ static void block_full_4( struct lp_rasterizer *rast, int x, int y ) { - blocks[nr_blocks].x = x; - blocks[nr_blocks].y = y; - blocks[nr_blocks].mask = ~0; - nr_blocks++; + int i = rast->nr_blocks; + rast->blocks[i].x = x; + rast->blocks[i].y = y; + rast->blocks[i].mask = ~0; + rast->nr_blocks++; } @@ -86,15 +81,15 @@ do_block_4( struct lp_rasterizer *rast, (c2 + tri->step[1][i]) | (c3 + tri->step[2][i])) >> 31)) & (1 << i); - /* As we do trivial reject already, masks should rarely be all * zero: */ if (mask) { - blocks[nr_blocks].x = x; - blocks[nr_blocks].y = y; - blocks[nr_blocks].mask = mask; - nr_blocks++; + int i = rast->nr_blocks; + rast->blocks[i].x = x; + rast->blocks[i].y = y; + rast->blocks[i].mask = mask; + rast->nr_blocks++; } } @@ -169,7 +164,7 @@ void lp_rast_triangle( struct lp_rasterizer *rast, debug_printf("%s\n", __FUNCTION__); - nr_blocks = 0; + rast->nr_blocks = 0; for (iy = 0; iy < 64; iy+=16) { @@ -197,10 +192,10 @@ void lp_rast_triangle( struct lp_rasterizer *rast, } } - for (i = 0; i < nr_blocks; i++) + for (i = 0; i < rast->nr_blocks; i++) lp_rast_shade_quads(rast, &tri->inputs, - blocks[i].x, - blocks[i].y, - blocks[i].mask); + rast->blocks[i].x, + rast->blocks[i].y, + rast->blocks[i].mask); } |