diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp index 137e3bb..a6685b9 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp @@ -335,7 +335,8 @@ src_reg::equals(src_reg *r) } static bool -try_eliminate_instruction(vec4_instruction *inst, int new_writemask) +try_eliminate_instruction(vec4_instruction *inst, int new_writemask, + const struct brw_context *brw) { if (new_writemask == 0) { /* Don't dead code eliminate instructions that write to the @@ -364,7 +365,8 @@ try_eliminate_instruction(vec4_instruction *inst, int new_writemask) case VS_OPCODE_PULL_CONSTANT_LOAD_GEN7: break; default: - if (!inst->is_tex()) { + if (!inst->is_tex() || + !(brw->gen == 6 && inst->is_math())) { inst->dst.writemask = new_writemask; return true; } @@ -420,7 +422,8 @@ vec4_visitor::dead_code_eliminate() } } - progress = try_eliminate_instruction(inst, write_mask) || progress; + progress = try_eliminate_instruction(inst, write_mask, brw) || + progress; } if (seen_control_flow || inst->predicate || inst->prev == NULL) @@ -469,7 +472,7 @@ vec4_visitor::dead_code_eliminate() if (inst->dst.reg == scan_inst->dst.reg) { int new_writemask = scan_inst->dst.writemask & ~dead_channels; - progress = try_eliminate_instruction(scan_inst, new_writemask) || + progress = try_eliminate_instruction(scan_inst, new_writemask, brw) || progress; }