mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-01 03:48:06 +02:00
brw: Allow emit instruction with only number of sources
The emit will allocate the necessary number of sources but will let the caller fill them in. Change a couple of places to take advantage of that. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36730>
This commit is contained in:
parent
3ef86a8d00
commit
8f16cac492
3 changed files with 13 additions and 8 deletions
|
|
@ -292,6 +292,12 @@ public:
|
|||
return emit(opcode, brw_reg(), NULL, 0);
|
||||
}
|
||||
|
||||
brw_inst *
|
||||
emit(enum opcode opcode, unsigned num_srcs) const
|
||||
{
|
||||
return emit(brw_new_inst(*shader, opcode, dispatch_width(), brw_reg(), num_srcs));
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and insert a nullary instruction into the program.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -648,8 +648,7 @@ brw_emit_repclear_shader(brw_shader &s)
|
|||
if (i > 0)
|
||||
bld.uniform().MOV(component(header, 2), brw_imm_ud(i));
|
||||
|
||||
write = bld.emit(SHADER_OPCODE_SEND);
|
||||
write->resize_sources(SEND_NUM_SRCS);
|
||||
write = bld.emit(SHADER_OPCODE_SEND, SEND_NUM_SRCS);
|
||||
|
||||
/* We can use a headerless message for the first render target */
|
||||
write->header_size = i == 0 ? 0 : 2;
|
||||
|
|
|
|||
|
|
@ -106,13 +106,13 @@ brw_workaround_memory_fence_before_eot(brw_shader &s)
|
|||
const brw_builder ubld = brw_builder(inst).uniform();
|
||||
|
||||
brw_reg dst = ubld.vgrf(BRW_TYPE_UD);
|
||||
brw_inst *dummy_fence = ubld.emit(SHADER_OPCODE_SEND, dst);
|
||||
brw_inst *dummy_fence = ubld.emit(SHADER_OPCODE_SEND, SEND_NUM_SRCS);
|
||||
|
||||
dummy_fence->resize_sources(4);
|
||||
dummy_fence->src[0] = brw_imm_ud(0);
|
||||
dummy_fence->src[1] = brw_imm_ud(0);
|
||||
dummy_fence->src[2] = brw_vec8_grf(0, 0);
|
||||
dummy_fence->src[3] = brw_reg();
|
||||
dummy_fence->src[SEND_SRC_DESC] = brw_imm_ud(0);
|
||||
dummy_fence->src[SEND_SRC_EX_DESC] = brw_imm_ud(0);
|
||||
dummy_fence->src[SEND_SRC_PAYLOAD1] = brw_vec8_grf(0, 0);
|
||||
dummy_fence->src[SEND_SRC_PAYLOAD2] = brw_reg();
|
||||
dummy_fence->dst = dst;
|
||||
dummy_fence->mlen = reg_unit(s.devinfo);
|
||||
dummy_fence->ex_mlen = 0;
|
||||
dummy_fence->sfid = BRW_SFID_UGM;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue