i965/fs: Fix copy propagation with smearing.
authorEric Anholt <eric@anholt.net>
Sat, 16 Feb 2013 05:10:06 +0000 (21:10 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 19 Feb 2013 18:33:15 +0000 (10:33 -0800)
We were correctly relaying the smear from MOV's src, but if the MOV
didn't do a smear, we don't want to smash the smear value from the
instruction being propagated into.  Prevents a regression in the
upcoming UBO change.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 9.1 branch.

src/mesa/drivers/dri/i965/brw_fs_copy_propagation.cpp

index c4ec1d97c136be468f82760a3956053702591ede..194ed07cb3fa87acdaac4c172c802f2699c9e884 100644 (file)
@@ -223,7 +223,8 @@ fs_visitor::try_copy_propagate(fs_inst *inst, int arg, acp_entry *entry)
    inst->src[arg].file = entry->src.file;
    inst->src[arg].reg = entry->src.reg;
    inst->src[arg].reg_offset = entry->src.reg_offset;
-   inst->src[arg].smear = entry->src.smear;
+   if (entry->src.smear != -1)
+      inst->src[arg].smear = entry->src.smear;
 
    if (!inst->src[arg].abs) {
       inst->src[arg].abs = entry->src.abs;