diff options
author | Brian Paul <brianp@vmware.com> | 2009-12-04 11:50:40 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-12-04 11:50:43 -0700 |
commit | b1659b9213f3eeee440590dfe379f0d193948307 (patch) | |
tree | 7aa9c3419c3debad517a3d9b33ff21989f9396b2 /src/gallium/drivers/llvmpipe/lp_rast.c | |
parent | 9dca0100489c7a7c02af77da42a39dbe1560d7e2 (diff) |
llvmpipe: bin state-change commands
Previously, each triangle had a pointer to the state to use for shading.
Now we insert state-change commands into the bins. When we execute one
of those commands we just update a 'current state' pointer and use that
pointer when calling the jit shader.
When inserting state-change commands into a bin we check if the previous
command was also a state-change command and simply replace it. This
avoids accumulating useless/redundant state-change commands.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_rast.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_rast.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index d5fe6e9369..8f37a28e87 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -237,9 +237,10 @@ void lp_rast_set_state( struct lp_rasterizer *rast, { const struct lp_rast_state *state = arg.set_state; - RAST_DEBUG("%s\n", __FUNCTION__); + RAST_DEBUG("%s %p\n", __FUNCTION__, (void *) state); - /* XXX to do */ + /* just set the current state pointer for this rasterizer */ + rast->current_state = state; } @@ -279,7 +280,7 @@ void lp_rast_shade_quads( struct lp_rasterizer *rast, unsigned mask) { #if 1 - const struct lp_rast_state *state = inputs->state; + const struct lp_rast_state *state = rast->current_state; struct lp_rast_tile *tile = &rast->tile; void *color; void *depth; @@ -287,6 +288,8 @@ void lp_rast_shade_quads( struct lp_rasterizer *rast, unsigned ix, iy; int block_offset; + assert(state); + /* Sanity checks */ assert(x % TILE_VECTOR_WIDTH == 0); assert(y % TILE_VECTOR_HEIGHT == 0); |