OSDN Git Service

softpipe: fix unreliable FS variant binding bug
authorBrian Paul <brianp@vmware.com>
Fri, 14 Dec 2012 17:34:33 +0000 (10:34 -0700)
committerBrian Paul <brianp@vmware.com>
Wed, 19 Dec 2012 16:02:08 +0000 (09:02 -0700)
commit18ef8f83b2586de037df7e578d88cbfb6e764012
treef971e771f3c63cd6a97f527c6c4e59a5f179ddeb
parent50880314e35661f0ea7ab3f092741df79c855d90
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.
src/gallium/drivers/softpipe/sp_fs_exec.c
src/gallium/drivers/softpipe/sp_quad_fs.c
src/gallium/drivers/softpipe/sp_state_derived.c