summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/softpipe/sp_state_fs.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2009-12-26 21:05:31 +0000
committerJosé Fonseca <jfonseca@vmware.com>2009-12-26 21:06:46 +0000
commit4ccf0bb74e7f88ff51bba64a2a94a29f997231f5 (patch)
tree96f0f201782979a21abe1c8f5a3be02f4234e038 /src/gallium/drivers/softpipe/sp_state_fs.c
parent080703e398f737b71336312fd3dc8d6f38f61e51 (diff)
softpipe: Flush draw module when fragment pipeline state changes.
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_state_fs.c')
-rw-r--r--src/gallium/drivers/softpipe/sp_state_fs.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_fs.c b/src/gallium/drivers/softpipe/sp_state_fs.c
index acec62dc2a..aa12bb215a 100644
--- a/src/gallium/drivers/softpipe/sp_state_fs.c
+++ b/src/gallium/drivers/softpipe/sp_state_fs.c
@@ -69,7 +69,14 @@ softpipe_bind_fs_state(struct pipe_context *pipe, void *fs)
{
struct softpipe_context *softpipe = softpipe_context(pipe);
- softpipe->fs = (struct sp_fragment_shader *) fs;
+ draw_flush(softpipe->draw);
+
+ if (softpipe->fs == fs)
+ return;
+
+ draw_flush(softpipe->draw);
+
+ softpipe->fs = fs;
softpipe->dirty |= SP_NEW_FS;
}
@@ -159,6 +166,8 @@ softpipe_set_constant_buffer(struct pipe_context *pipe,
assert(shader < PIPE_SHADER_TYPES);
assert(index == 0);
+ draw_flush(softpipe->draw);
+
/* note: reference counting */
pipe_buffer_reference(&softpipe->constants[shader].buffer,
buf ? buf->buffer : NULL);