From 080703e398f737b71336312fd3dc8d6f38f61e51 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 26 Dec 2009 15:21:16 +0000 Subject: 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. --- src/gallium/drivers/llvmpipe/lp_state_vs.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/gallium/drivers/llvmpipe/lp_state_vs.c') 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; } -- cgit v1.2.3