i965/fs: Take into account copy register offset during compute-to-mrf.
authorFrancisco Jerez <currojerez@riseup.net>
Sat, 3 Sep 2016 20:04:23 +0000 (13:04 -0700)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 14 Sep 2016 21:50:56 +0000 (14:50 -0700)
This was dropping 'inst->dst.offset' on the floor.  Nothing in the
code above seems to guarantee that it's zero and in that case the
offset of the register being coalesced into wouldn't be taken into
account while rewriting the generating instruction.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/mesa/drivers/dri/i965/brw_fs.cpp

index a52e5a37950ba991b0b7f73574ee906d729800de..ee196665fce30ca947a972d24f599183fa551d91 100644 (file)
@@ -2821,7 +2821,7 @@ fs_visitor::compute_to_mrf()
             }
 
             scan_inst->dst.file = MRF;
-            scan_inst->dst.offset %= REG_SIZE;
+            scan_inst->dst.offset = inst->dst.offset + scan_inst->dst.offset % REG_SIZE;
             scan_inst->saturate |= inst->saturate;
             if (!regs_left)
                break;