X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fdrivers%2Fdri%2Fi965%2Fbrw_vec4_dead_code_eliminate.cpp;h=c643212494b24b841772aef4d7443996431dd4ee;hb=be095e11e41158f91bcb3f6fcbc2e2a91a5d9124;hp=c31e72def67d5173223548c1113a525728de2c59;hpb=ea77b384e8c575922eca1c05398e19fcbfda9b09;p=mesa.git diff --git a/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp b/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp index c31e72def67..c643212494b 100644 --- a/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp +++ b/src/mesa/drivers/dri/i965/brw_vec4_dead_code_eliminate.cpp @@ -36,33 +36,6 @@ using namespace brw; -static bool -can_do_writemask(const struct brw_device_info *devinfo, - const vec4_instruction *inst) -{ - switch (inst->opcode) { - case SHADER_OPCODE_GEN4_SCRATCH_READ: - case VS_OPCODE_PULL_CONSTANT_LOAD: - case VS_OPCODE_PULL_CONSTANT_LOAD_GEN7: - case VS_OPCODE_SET_SIMD4X2_HEADER_GEN9: - case TCS_OPCODE_SET_INPUT_URB_OFFSETS: - case TCS_OPCODE_SET_OUTPUT_URB_OFFSETS: - case VEC4_OPCODE_URB_READ: - return false; - default: - /* The MATH instruction on Gen6 only executes in align1 mode, which does - * not support writemasking. - */ - if (devinfo->gen == 6 && inst->is_math()) - return false; - - if (inst->is_tex()) - return false; - - return true; - } -} - bool vec4_visitor::dead_code_eliminate() { @@ -99,7 +72,7 @@ vec4_visitor::dead_code_eliminate() /* If the instruction can't do writemasking, then it's all or * nothing. */ - if (!can_do_writemask(devinfo, inst)) { + if (!inst->can_do_writemask(devinfo)) { bool result = result_live[0] | result_live[1] | result_live[2] | result_live[3]; result_live[0] = result;