Mesa (9.1): mesa/st: Don't copy propagate from swizzles.
Ian Romanick
idr at kemper.freedesktop.org
Wed May 29 20:37:33 UTC 2013
Module: Mesa
Branch: 9.1
Commit: 4a34ac492bdcb9a27c4ee3f509936eb6d50836fb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=4a34ac492bdcb9a27c4ee3f509936eb6d50836fb
Author: Fabian Bieler <fabianbieler at fastmail.fm>
Date: Sat Apr 20 19:40:11 2013 +0200
mesa/st: 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 gallium drivers.
NOTE: This is a candidate for the stable branches.
Signed-off-by: Fabian Bieler <fabianbieler at fastmail.fm>
Reviewed-by: Brian Paul <brianp at vmware.com>
(cherry picked from commit e1ff753d67a355ad20443173b99613a1198331c1)
---
src/mesa/state_tracker/st_glsl_to_tgsi.cpp | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index c6ac634..4286f0e 100644
--- a/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -3506,6 +3506,8 @@ glsl_to_tgsi_visitor::copy_propagate(void)
/* If this is a copy, add it to the ACP. */
if (inst->op == TGSI_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 &&
More information about the mesa-commit
mailing list