summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_state_vs.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_vs.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_vs.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_state_vs.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_state_vs.c b/src/gallium/drivers/llvmpipe/lp_state_vs.c
index 8a761648e7..884e3878e6 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_vs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_vs.c
@@ -70,14 +70,18 @@ fail:
void
-llvmpipe_bind_vs_state(struct pipe_context *pipe, void *vs)
+llvmpipe_bind_vs_state(struct pipe_context *pipe, void *_vs)
{
struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe);
+ const struct lp_vertex_shader *vs = (const struct lp_vertex_shader *)_vs;
- llvmpipe->vs = (const struct lp_vertex_shader *)vs;
+ if (llvmpipe->vs == vs)
+ return;
- draw_bind_vertex_shader(llvmpipe->draw,
- (llvmpipe->vs ? llvmpipe->vs->draw_data : NULL));
+ draw_bind_vertex_shader(llvmpipe->draw,
+ vs ? vs->draw_data : NULL);
+
+ llvmpipe->vs = vs;
llvmpipe->dirty |= LP_NEW_VS;
}