glsl: Fix copy_propagation_elements bug in handling self-copies.
authorEric Anholt <eric@anholt.net>
Mon, 9 Jan 2012 21:30:55 +0000 (13:30 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 11 Jan 2012 00:44:16 +0000 (16:44 -0800)
commit057f9ae54b5efb0020cc0c049d50e778de3f3f7a
treeb18581e837e3cf54f0f0ed061ef121393c0a0d89
parent254b24f19511014cdf4741b73d69349ac9e931a2
glsl: Fix copy_propagation_elements bug in handling self-copies.

We were doing the kill of the updated channels, then adding our copy
to the list of available stuff to copy.  But if the copy was updating
its own source channels, we didn't notice, breaking this code:

R0.xyzw = arg0 + arg1;
R0.xyzw = R0.wwwx;
gl_FragColor.xyzw = clamp(R0.xyzw, 0.0, 1.0);

Fixes piglit glsl-copy-propagation-self-2.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/opt_copy_propagation_elements.cpp