diff options
author | Brian Paul <[email protected]> | 2012-12-14 10:34:33 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-12-19 09:02:08 -0700 |
commit | 18ef8f83b2586de037df7e578d88cbfb6e764012 (patch) | |
tree | f971e771f3c63cd6a97f527c6c4e59a5f179ddeb /src/gallium/drivers/softpipe/sp_state_derived.c | |
parent | 50880314e35661f0ea7ab3f092741df79c855d90 (diff) |
softpipe: fix unreliable FS variant binding bug
In exec_prepare() we were comparing pointers to see if the fragment
shader variant had changed before calling tgsi_exec_machine_bind_shader().
This didn't work reliably when there was a lot of shader token malloc/
freeing going on because the memory might get reused.
Instead, bind the shader variant during regular state validation.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=40404
(fixes a couple of piglit's glsl-max-varyings test)
Note: This is a candidate for the stable branches.
Diffstat (limited to 'src/gallium/drivers/softpipe/sp_state_derived.c')
-rw-r--r-- | src/gallium/drivers/softpipe/sp_state_derived.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/softpipe/sp_state_derived.c b/src/gallium/drivers/softpipe/sp_state_derived.c index cb954a17ef6..e4a5a632097 100644 --- a/src/gallium/drivers/softpipe/sp_state_derived.c +++ b/src/gallium/drivers/softpipe/sp_state_derived.c @@ -242,6 +242,12 @@ update_fragment_shader(struct softpipe_context *softpipe, unsigned prim) if (softpipe->fs) { softpipe->fs_variant = softpipe_find_fs_variant(softpipe, softpipe->fs, &key); + + /* prepare the TGSI interpreter for FS execution */ + softpipe->fs_variant->prepare(softpipe->fs_variant, + softpipe->fs_machine, + (struct tgsi_sampler **) softpipe-> + tgsi.samplers_list[PIPE_SHADER_FRAGMENT]); } else { softpipe->fs_variant = NULL; |