summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/llvmpipe/lp_rast.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2009-10-20 02:46:00 +0100
committerKeith Whitwell <[email protected]>2009-10-20 02:46:00 +0100
commit7670628061c2a6ce0a1a787556b0e33a38fd3049 (patch)
tree7aed343a2d002847cb33e0b6ec61454fcdb34156 /src/gallium/drivers/llvmpipe/lp_rast.c
parent5b07d4de38b732f99237161d940f40e3ce6e29c3 (diff)
llvmpipe: precalculate some offsets
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_rast.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c
index 85b756e4535..39fb8cdb6ba 100644
--- a/src/gallium/drivers/llvmpipe/lp_rast.c
+++ b/src/gallium/drivers/llvmpipe/lp_rast.c
@@ -193,12 +193,7 @@ void lp_rast_shade_tile( struct lp_rasterizer *rast,
const union lp_rast_cmd_arg arg )
{
const struct lp_rast_shader_inputs *inputs = arg.shade_tile;
- static const uint32_t ALIGN16_ATTRIB masks[4][4] =
- { {~0, ~0, ~0, ~0},
- {~0, ~0, ~0, ~0},
- {~0, ~0, ~0, ~0},
- {~0, ~0, ~0, ~0} };
-
+ const unsigned mask = ~0;
unsigned x, y;
RAST_DEBUG("%s\n", __FUNCTION__);
@@ -207,26 +202,31 @@ void lp_rast_shade_tile( struct lp_rasterizer *rast,
*/
for (y = 0; y < TILE_SIZE; y += 4)
for (x = 0; x < TILE_SIZE; x += 4)
- lp_rast_shade_quads( rast, inputs, rast->x + x, rast->y + y, &masks[0][0]);
+ lp_rast_shade_quads( rast, inputs, rast->x + x, rast->y + y, mask);
}
void lp_rast_shade_quads( struct lp_rasterizer *rast,
const struct lp_rast_shader_inputs *inputs,
unsigned x, unsigned y,
- const uint32_t *masks)
+ unsigned mask)
{
#if 1
const struct lp_rast_state *state = inputs->state;
struct lp_rast_tile *tile = &rast->tile;
void *color;
void *depth;
- unsigned ix, iy;
+ uint32_t ALIGN16_ATTRIB masks[16];
+ unsigned ix, iy, i;
/* Sanity checks */
assert(x % TILE_VECTOR_WIDTH == 0);
assert(y % TILE_VECTOR_HEIGHT == 0);
+ /* mask */
+ for (i = 0; i < 16; ++i)
+ masks[i] = mask & (1 << i) ? ~0 : 0;
+
ix = x % TILE_SIZE;
iy = y % TILE_SIZE;
@@ -251,7 +251,7 @@ void lp_rast_shade_quads( struct lp_rasterizer *rast,
inputs->a0,
inputs->dadx,
inputs->dady,
- masks,
+ &masks[0],
color,
depth);
#else