OSDN Git Service

softpipe: fix dangling references to shaders in the TGSI executor
authorBrian Paul <brianp@vmware.com>
Thu, 6 May 2010 21:10:51 +0000 (15:10 -0600)
committerBrian Paul <brianp@vmware.com>
Thu, 6 May 2010 21:19:02 +0000 (15:19 -0600)
commit1fce9d58cc70deaff284e1d9d0ffcb15b61e7595
tree359a66509bf0a36ee3695663c4a103f59905504b
parent4b274f311c2c72e40e63c02e4a6f9f5ccc59f165
softpipe: fix dangling references to shaders in the TGSI executor

If a shader was bound to the fragment shader TGSI executor and it was
then deleted and a new shader was allocated at the same address as the
old shader, the new fragment shader would not get properly bound to
the TGSI machine and we'd wind up using the old one.

This would not have been a problem if shaders were refcounted.

Now the TGSI machine is owned by the context rather than the quad
pipeline's shader stage so that the softpipe_delete_fs_state()
function can access it.

Fixes sporadic failures of the piglit fp-long-alu test (fd.o bug 27989).
src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_context.h
src/gallium/drivers/softpipe/sp_quad_fs.c
src/gallium/drivers/softpipe/sp_state_fs.c