diff options
author | Fabian Bieler <[email protected]> | 2013-04-25 01:30:15 +0200 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-05-08 13:59:19 -0700 |
commit | 4e9c7f9c5ac7b2564c1c7299bf688595e1f88372 (patch) | |
tree | 925c1cbc624ac704a2c334802a800abc7ab76a9d | |
parent | e1ff753d67a355ad20443173b99613a1198331c1 (diff) |
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 <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
-rw-r--r-- | src/mesa/program/ir_to_mesa.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp index 084846201c9..363efe7da65 100644 --- a/src/mesa/program/ir_to_mesa.cpp +++ b/src/mesa/program/ir_to_mesa.cpp @@ -2768,6 +2768,8 @@ ir_to_mesa_visitor::copy_propagate(void) /* If this is a copy, add it to the ACP. */ if (inst->op == OPCODE_MOV && inst->dst.file == PROGRAM_TEMPORARY && + !(inst->dst.file == inst->src[0].file && + inst->dst.index == inst->src[0].index) && !inst->dst.reladdr && !inst->saturate && !inst->src[0].reladdr && |