summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-12-26 15:21:16 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-12-26 21:06:46 +0000
commit080703e398f737b71336312fd3dc8d6f38f61e51 (patch)
tree5c3348ba2886991aac449e8ee8754371fbb67cce /src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
parentc4ac1f8299ddc3b60f7f32c58c0310deacac22c6 (diff)
llvmpipe: Treat state changes systematically.
That is: - check for no op - update/flush draw module - update bound state and mark it as dirty In particular flushing the draw module is important since it may contain unflushed primitives which would otherwise be draw with wrong state.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_state_rasterizer.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_rasterizer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
index 4561c6b845..aa3b5a3f91 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_rasterizer.c
@@ -41,14 +41,17 @@ llvmpipe_create_rasterizer_state(struct pipe_context *pipe,
}
void llvmpipe_bind_rasterizer_state(struct pipe_context *pipe,
- void *setup)
+ void *rasterizer)
{
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
+ if (llvmpipe->rasterizer == rasterizer)
+ return;
+
/* pass-through to draw module */
- draw_set_rasterizer_state(llvmpipe->draw, setup);
+ draw_set_rasterizer_state(llvmpipe->draw, rasterizer);
- llvmpipe->rasterizer = (struct pipe_rasterizer_state *)setup;
+ llvmpipe->rasterizer = rasterizer;
llvmpipe->dirty |= LP_NEW_RASTERIZER;
}