diff options
author | Francisco Jerez <[email protected]> | 2018-06-02 15:15:15 -0700 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2018-07-09 23:46:57 -0700 |
commit | 27c211e30f92a0bf85bd03aab8f5e5de7d094a22 (patch) | |
tree | 8966e70c21f2f294fcb624708c980ae3c26457a9 /src/intel/compiler/brw_eu_emit.c | |
parent | 1c90ae5accc284cf6b27bcc25e5e3fc3cfb80407 (diff) |
intel/eu: Use descriptor constructors for sampler messages.
v2: Use SET_BITS macro instead of left shift (Ken).
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_eu_emit.c')
-rw-r--r-- | src/intel/compiler/brw_eu_emit.c | 45 |
1 files changed, 6 insertions, 39 deletions
diff --git a/src/intel/compiler/brw_eu_emit.c b/src/intel/compiler/brw_eu_emit.c index 18378b847a9..6d9e7e081e1 100644 --- a/src/intel/compiler/brw_eu_emit.c +++ b/src/intel/compiler/brw_eu_emit.c @@ -552,36 +552,6 @@ brw_set_dp_read_message(struct brw_codegen *p, brw_inst_set_dp_read_target_cache(devinfo, insn, target_cache); } -void -brw_set_sampler_message(struct brw_codegen *p, - brw_inst *inst, - unsigned binding_table_index, - unsigned sampler, - unsigned msg_type, - unsigned response_length, - unsigned msg_length, - unsigned header_present, - unsigned simd_mode, - unsigned return_format) -{ - const struct gen_device_info *devinfo = p->devinfo; - - brw_set_desc(p, inst, brw_message_desc( - devinfo, msg_length, response_length, header_present)); - - const unsigned opcode = brw_inst_opcode(devinfo, inst); - if (opcode == BRW_OPCODE_SEND || opcode == BRW_OPCODE_SENDC) - brw_inst_set_sfid(devinfo, inst, BRW_SFID_SAMPLER); - brw_inst_set_binding_table_index(devinfo, inst, binding_table_index); - brw_inst_set_sampler(devinfo, inst, sampler); - brw_inst_set_sampler_msg_type(devinfo, inst, msg_type); - if (devinfo->gen >= 5) { - brw_inst_set_sampler_simd_mode(devinfo, inst, simd_mode); - } else if (devinfo->gen == 4 && !devinfo->is_g4x) { - brw_inst_set_sampler_return_format(devinfo, inst, return_format); - } -} - static void gen7_set_dp_scratch_message(struct brw_codegen *p, brw_inst *inst, @@ -2392,6 +2362,7 @@ void brw_SAMPLE(struct brw_codegen *p, gen6_resolve_implied_move(p, &src0, msg_reg_nr); insn = next_insn(p, BRW_OPCODE_SEND); + brw_inst_set_sfid(devinfo, insn, BRW_SFID_SAMPLER); brw_inst_set_pred_control(devinfo, insn, BRW_PREDICATE_NONE); /* XXX */ /* From the 965 PRM (volume 4, part 1, section 14.2.41): @@ -2413,15 +2384,11 @@ void brw_SAMPLE(struct brw_codegen *p, brw_set_dest(p, insn, dest); brw_set_src0(p, insn, src0); - brw_set_sampler_message(p, insn, - binding_table_index, - sampler, - msg_type, - response_length, - msg_length, - header_present, - simd_mode, - return_format); + brw_set_desc(p, insn, + brw_message_desc(devinfo, msg_length, response_length, + header_present) | + brw_sampler_desc(devinfo, binding_table_index, sampler, + msg_type, simd_mode, return_format)); } /* Adjust the message header's sampler state pointer to |