unsigned binding_table_index,
unsigned msg_control,
unsigned msg_type,
+ unsigned target_cache,
unsigned msg_length,
bool header_present,
unsigned last_render_target,
unsigned send_commit_msg)
{
const struct gen_device_info *devinfo = p->devinfo;
- unsigned sfid;
-
- if (devinfo->gen >= 7) {
- /* Use the Render Cache for RT writes; otherwise use the Data Cache */
- if (msg_type == GEN6_DATAPORT_WRITE_MESSAGE_RENDER_TARGET_WRITE)
- sfid = GEN6_SFID_DATAPORT_RENDER_CACHE;
- else
- sfid = GEN7_SFID_DATAPORT_DATA_CACHE;
- } else if (devinfo->gen == 6) {
- /* Use the render cache for all write messages. */
- sfid = GEN6_SFID_DATAPORT_RENDER_CACHE;
- } else {
- sfid = BRW_SFID_DATAPORT_WRITE;
- }
+ const unsigned sfid = (devinfo->gen >= 6 ? target_cache :
+ BRW_SFID_DATAPORT_WRITE);
brw_set_message_descriptor(p, insn, sfid, msg_length, response_length,
header_present, end_of_thread);
unsigned response_length)
{
const struct gen_device_info *devinfo = p->devinfo;
- unsigned sfid;
-
- if (devinfo->gen >= 7) {
- if (target_cache == BRW_DATAPORT_READ_TARGET_RENDER_CACHE)
- sfid = GEN6_SFID_DATAPORT_RENDER_CACHE;
- else if (target_cache == BRW_DATAPORT_READ_TARGET_DATA_CACHE)
- sfid = GEN7_SFID_DATAPORT_DATA_CACHE;
- else if (target_cache == BRW_DATAPORT_READ_TARGET_SAMPLER_CACHE)
- sfid = GEN6_SFID_DATAPORT_SAMPLER_CACHE;
- else
- unreachable("Invalid target cache");
-
- } else if (devinfo->gen == 6) {
- if (target_cache == BRW_DATAPORT_READ_TARGET_RENDER_CACHE)
- sfid = GEN6_SFID_DATAPORT_RENDER_CACHE;
- else
- sfid = GEN6_SFID_DATAPORT_SAMPLER_CACHE;
- } else {
- sfid = BRW_SFID_DATAPORT_READ;
- }
+ const unsigned sfid = (devinfo->gen >= 6 ? target_cache :
+ BRW_SFID_DATAPORT_READ);
brw_set_message_descriptor(p, insn, sfid, msg_length, response_length,
header_present, false);
unsigned offset)
{
const struct gen_device_info *devinfo = p->devinfo;
+ const unsigned target_cache =
+ (devinfo->gen >= 7 ? GEN7_SFID_DATAPORT_DATA_CACHE :
+ devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_RENDER_CACHE :
+ BRW_DATAPORT_READ_TARGET_RENDER_CACHE);
uint32_t msg_type;
if (devinfo->gen >= 6)
brw_scratch_surface_idx(p),
msg_control,
msg_type,
+ target_cache,
mlen,
true, /* header_present */
0, /* not a render target */
num_regs == 2 ? BRW_DATAPORT_OWORD_BLOCK_4_OWORDS :
num_regs == 4 ? BRW_DATAPORT_OWORD_BLOCK_8_OWORDS : 0);
assert(msg_control);
- const unsigned target_cache = devinfo->gen >= 7 ?
- BRW_DATAPORT_READ_TARGET_DATA_CACHE :
- BRW_DATAPORT_READ_TARGET_RENDER_CACHE;
+ const unsigned target_cache =
+ (devinfo->gen >= 7 ? GEN7_SFID_DATAPORT_DATA_CACHE :
+ devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_RENDER_CACHE :
+ BRW_DATAPORT_READ_TARGET_RENDER_CACHE);
{
brw_push_insn_state(p);
uint32_t bind_table_index)
{
const struct gen_device_info *devinfo = p->devinfo;
+ const unsigned target_cache =
+ (devinfo->gen >= 7 ? GEN7_SFID_DATAPORT_DATA_CACHE :
+ devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_SAMPLER_CACHE :
+ BRW_DATAPORT_READ_TARGET_DATA_CACHE);
/* On newer hardware, offset is in units of owords. */
if (devinfo->gen >= 6)
bind_table_index,
BRW_DATAPORT_OWORD_BLOCK_1_OWORDLOW,
BRW_DATAPORT_READ_MESSAGE_OWORD_BLOCK_READ,
- BRW_DATAPORT_READ_TARGET_DATA_CACHE,
+ target_cache,
1, /* msg_length */
true, /* header_present */
1); /* response_length (1 reg, 2 owords!) */
bool header_present)
{
const struct gen_device_info *devinfo = p->devinfo;
+ const unsigned target_cache =
+ (devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_RENDER_CACHE :
+ BRW_DATAPORT_READ_TARGET_RENDER_CACHE);
brw_inst *insn;
unsigned msg_type;
struct brw_reg dest, src0;
binding_table_index,
msg_control,
msg_type,
+ target_cache,
msg_length,
header_present,
last_render_target,
brw_set_dp_read_message(p, insn, binding_table_index,
per_sample << 5 | msg_subtype,
GEN9_DATAPORT_RC_RENDER_TARGET_READ,
- BRW_DATAPORT_READ_TARGET_RENDER_CACHE,
+ GEN6_SFID_DATAPORT_RENDER_CACHE,
msg_length, true /* header_present */,
response_length);
brw_inst_set_rt_slot_group(devinfo, insn,
unsigned binding_table_index,
bool send_commit_msg)
{
+ const struct gen_device_info *devinfo = p->devinfo;
+ const unsigned target_cache =
+ (devinfo->gen >= 7 ? GEN7_SFID_DATAPORT_DATA_CACHE :
+ devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_RENDER_CACHE :
+ BRW_DATAPORT_READ_TARGET_RENDER_CACHE);
brw_inst *insn;
gen6_resolve_implied_move(p, &src0, msg_reg_nr);
binding_table_index,
0, /* msg_control: ignored */
GEN6_DATAPORT_WRITE_MESSAGE_STREAMED_VB_WRITE,
+ target_cache,
1, /* msg_length */
true, /* header_present */
0, /* last_render_target: ignored */
else
msg_type = BRW_DATAPORT_READ_MESSAGE_OWORD_DUAL_BLOCK_READ;
- const unsigned target_cache = devinfo->gen >= 7 ?
- BRW_DATAPORT_READ_TARGET_DATA_CACHE :
+ const unsigned target_cache =
+ devinfo->gen >= 7 ? GEN7_SFID_DATAPORT_DATA_CACHE :
+ devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_RENDER_CACHE :
BRW_DATAPORT_READ_TARGET_RENDER_CACHE;
/* Each of the 8 channel enables is considered for whether each
struct brw_reg index)
{
const struct gen_device_info *devinfo = p->devinfo;
+ const unsigned target_cache =
+ (devinfo->gen >= 7 ? GEN7_SFID_DATAPORT_DATA_CACHE :
+ devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_RENDER_CACHE :
+ BRW_DATAPORT_READ_TARGET_RENDER_CACHE);
struct brw_reg header = brw_vec8_grf(0, 0);
bool write_commit;
brw_scratch_surface_idx(p),
BRW_DATAPORT_OWORD_DUAL_BLOCK_1OWORD,
msg_type,
+ target_cache,
3, /* mlen */
true, /* header present */
false, /* not a render target write */
struct brw_reg offset)
{
const struct gen_device_info *devinfo = p->devinfo;
+ const unsigned target_cache =
+ (devinfo->gen >= 6 ? GEN6_SFID_DATAPORT_SAMPLER_CACHE :
+ BRW_DATAPORT_READ_TARGET_DATA_CACHE);
assert(index.file == BRW_IMMEDIATE_VALUE &&
index.type == BRW_REGISTER_TYPE_UD);
uint32_t surf_index = index.ud;
surf_index,
BRW_DATAPORT_OWORD_DUAL_BLOCK_1OWORD,
msg_type,
- BRW_DATAPORT_READ_TARGET_DATA_CACHE,
+ target_cache,
2, /* mlen */
true, /* header_present */
1 /* rlen */);