i965/compute: Fix uniform init issue when SIMD8 is skipped
[mesa.git] / src / mesa / drivers / dri / i965 / brw_fs_saturate_propagation.cpp
index 7c825097ca26e6acb33a1829049db985d9253cde..f59fdbddfa69c08c827f19f3407605d94ee16b4d 100644 (file)
@@ -73,7 +73,7 @@ opt_saturate_propagation_local(fs_visitor *v, bblock_t *block)
             if (scan_inst->saturate) {
                inst->saturate = false;
                progress = true;
-            } else if (src_end_ip <= ip || inst->dst.equals(inst->src[0])) {
+            } else if (src_end_ip == ip || inst->dst.equals(inst->src[0])) {
                if (scan_inst->can_do_saturate()) {
                   if (scan_inst->dst.type != inst->dst.type) {
                      scan_inst->dst.type = inst->dst.type;
@@ -86,6 +86,10 @@ opt_saturate_propagation_local(fs_visitor *v, bblock_t *block)
                      if (scan_inst->opcode == BRW_OPCODE_MUL) {
                         scan_inst->src[0].negate = !scan_inst->src[0].negate;
                         inst->src[0].negate = false;
+                     } else if (scan_inst->opcode == BRW_OPCODE_MAD) {
+                        scan_inst->src[0].negate = !scan_inst->src[0].negate;
+                        scan_inst->src[1].negate = !scan_inst->src[1].negate;
+                        inst->src[0].negate = false;
                      } else if (scan_inst->opcode == BRW_OPCODE_ADD) {
                         if (scan_inst->src[1].file == IMM) {
                            if (!brw_negate_immediate(scan_inst->src[1].type,