-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:
- 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;
- }
-}
-