i965/vec4: Don't lose the force_writemask_all flag during CSE.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_fs_saturate_propagation.cpp
index bc516618c3d3cd983e5e8c07258a61f65f87e803..e406c2899e89c954b257364ad1da979f70de42d9 100644 (file)
@@ -81,12 +81,16 @@ opt_saturate_propagation_local(fs_visitor *v, bblock_t *block)
             break;
          }
          for (int i = 0; i < scan_inst->sources; i++) {
-            if ((scan_inst->opcode != BRW_OPCODE_MOV || !scan_inst->saturate) &&
-                scan_inst->src[i].file == GRF &&
+            if (scan_inst->src[i].file == GRF &&
                 scan_inst->src[i].reg == inst->src[0].reg &&
                 scan_inst->src[i].reg_offset == inst->src[0].reg_offset) {
-               interfered = true;
-               break;
+               if (scan_inst->opcode != BRW_OPCODE_MOV ||
+                   !scan_inst->saturate ||
+                   scan_inst->src[0].abs ||
+                   scan_inst->src[0].negate) {
+                  interfered = true;
+                  break;
+               }
             }
          }