i965/vs: Properly clear cur_value when propagating direct copies.
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 24 Dec 2011 04:24:46 +0000 (20:24 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 27 Dec 2011 22:33:38 +0000 (14:33 -0800)
commit07ee9f374f2946f852896e9264c7fa83eafc3f16
treeed1587848cfaf737542a990ae537e938bd18c4f8
parent443c8d1ab7ddad9392046e041e4e9a4fda7cd6e7
i965/vs: Properly clear cur_value when propagating direct copies.

Consider the following code:

MOV A.x, B.x
MOV B.x, C.x

After the first line, cur_value[A][0] == B, indicating that A.x's
current value came from register B.

When processing the second line, we update cur_value[B][0] to C.
However, for drect copies, we fail to reset cur_value[A][0] to NULL.
This is necessary because the value of A is no longer the value of B.

Fixes Counter-Strike: Source in Wine (where the menu rendered completely
black in DX9 mode), completely white textures in Civilization V, and the
new Piglit test glsl-vs-copy-propagation-1.shader_test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42032
Tested-by: Matt Turner <mattst88@gmail.com>
Tested-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_vec4_copy_propagation.cpp