mesa/program: Don't copy propagate from swizzles. 15/6515/1
authorFabian Bieler <fabianbieler@fastmail.fm>
Wed, 24 Apr 2013 23:30:15 +0000 (01:30 +0200)
committerIan Romanick <ian.d.romanick@intel.com>
Wed, 8 May 2013 20:59:19 +0000 (13:59 -0700)
commit4e9c7f9c5ac7b2564c1c7299bf688595e1f88372
tree925c1cbc624ac704a2c334802a800abc7ab76a9d
parente1ff753d67a355ad20443173b99613a1198331c1
mesa/program: Don't copy propagate from swizzles.

Do not propagate a copy if source and destination are identical.

Otherwise code like

MOV TEMP[0].xyzw, TEMP[0].wzyx
MOV TEMP[1].xyzw, TEMP[0].xyzw

is changed to

MOV TEMP[0].xyzw, TEMP[0].wzyx
MOV TEMP[1].xyzw, TEMP[0].wzyx

This fixes Piglit test shaders/glsl-copy-propagation-self-2 for drivers that
use Mesa IR.

NOTE: This is a candidate for the stable branches.
Signed-off-by: Fabian Bieler <fabianbieler@fastmail.fm>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/program/ir_to_mesa.cpp