softpipe: fix unreliable FS variant binding bug
authorBrian Paul <brianp@vmware.com>
Fri, 14 Dec 2012 17:34:33 +0000 (10:34 -0700)
committerAndreas Boll <andreas.boll.dev@gmail.com>
Wed, 13 Feb 2013 17:46:38 +0000 (18:46 +0100)
commite8830f5a4009c3784836edb441319a62c7beef36
tree0da1345fc1a7dbe96543ab7e4b75e406d5e874cb
parente6e58cfa9dd8cbd5d6977822355d150e76eb987a
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.
(cherry picked from commit 18ef8f83b2586de037df7e578d88cbfb6e764012)
src/gallium/drivers/softpipe/sp_fs_exec.c
src/gallium/drivers/softpipe/sp_quad_fs.c
src/gallium/drivers/softpipe/sp_state_derived.c