summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2014-01-07 10:25:40 +0200
committerTapani Pälli <tapani.palli@intel.com>2014-01-08 07:06:45 +0200
commit0978a6966abb886539158934d11ae7f170786be2 (patch)
tree07da32062b301c441ad0794f88276dc7f260d8a3 /src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
parent847bc36a38d42967ad6bf0492fe90a4892d9d799 (diff)
downloadexternal_mesa3d-0978a6966abb886539158934d11ae7f170786be2.zip
external_mesa3d-0978a6966abb886539158934d11ae7f170786be2.tar.gz
external_mesa3d-0978a6966abb886539158934d11ae7f170786be2.tar.bz2
i965/fs: do SEL optimization only when src type for MOV matches
Fixes a bug where then branch operates with ivec4 while else uses vec4. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72379 Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp')
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
index d314799..db0be19 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_sel_peephole.cpp
@@ -169,6 +169,12 @@ fs_visitor::opt_peephole_sel()
break;
}
+ /* Check that source types for mov operations match. */
+ if (then_mov[i]->src[0].type != else_mov[i]->src[0].type) {
+ movs = i;
+ break;
+ }
+
if (!then_mov[i]->src[0].equals(else_mov[i]->src[0])) {
/* Only the last source register can be a constant, so if the MOV
* in the "then" clause uses a constant, we need to put it in a