intel/brw: Replace CS_OPCODE_CS_TERMINATE with SHADER_OPCODE_SEND

There's no need for special handling here, it's just a send message
with a trivial g0 header and descriptor.

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27924>
This commit is contained in:
Kenneth Graunke
2024-02-28 02:58:00 -08:00
committed by Marge Bot
parent f93f215898
commit 97bf3d3b2d
9 changed files with 42 additions and 92 deletions
-45
View File
@@ -611,46 +611,6 @@ fs_generator::generate_quad_swizzle(const fs_inst *inst,
}
}
void
fs_generator::generate_cs_terminate(fs_inst *inst, struct brw_reg payload)
{
struct brw_inst *insn;
insn = brw_next_insn(p, BRW_OPCODE_SEND);
brw_set_dest(p, insn, retype(brw_null_reg(), BRW_REGISTER_TYPE_UW));
brw_set_src0(p, insn, retype(payload, BRW_REGISTER_TYPE_UW));
if (devinfo->ver < 12)
brw_set_src1(p, insn, brw_imm_ud(0u));
/* For XeHP and newer send a message to the message gateway to terminate a
* compute shader. For older devices, a message is sent to the thread
* spawner.
*/
if (devinfo->verx10 >= 125)
brw_inst_set_sfid(devinfo, insn, BRW_SFID_MESSAGE_GATEWAY);
else
brw_inst_set_sfid(devinfo, insn, BRW_SFID_THREAD_SPAWNER);
brw_inst_set_mlen(devinfo, insn, 1);
brw_inst_set_rlen(devinfo, insn, 0);
brw_inst_set_eot(devinfo, insn, inst->eot);
brw_inst_set_header_present(devinfo, insn, false);
brw_inst_set_ts_opcode(devinfo, insn, 0); /* Dereference resource */
if (devinfo->ver < 11) {
brw_inst_set_ts_request_type(devinfo, insn, 0); /* Root thread */
/* Note that even though the thread has a URB resource associated with it,
* we set the "do not dereference URB" bit, because the URB resource is
* managed by the fixed-function unit, so it will free it automatically.
*/
brw_inst_set_ts_resource_select(devinfo, insn, 1); /* Do not dereference URB */
}
brw_inst_set_mask_control(devinfo, insn, BRW_MASK_DISABLE);
}
void
fs_generator::generate_barrier(fs_inst *, struct brw_reg src)
{
@@ -1469,11 +1429,6 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width,
}
break;
case CS_OPCODE_CS_TERMINATE:
generate_cs_terminate(inst, src[0]);
send_count++;
break;
case SHADER_OPCODE_BARRIER:
generate_barrier(inst, src[0]);
send_count++;