summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_eu_emit.c
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2016-07-21 19:13:55 -0700
committerFrancisco Jerez <currojerez@riseup.net>2016-08-25 18:36:08 -0700
commit26ac16fe2f73507041062f63646286dea60053da (patch)
tree5064e62f8e9d6ee27e1fa29d101e39e691922c8c /src/mesa/drivers/dri/i965/brw_eu_emit.c
parent29eb8059fd7906d2595ea99bc65a27691b9fbe53 (diff)
downloadexternal_mesa3d-26ac16fe2f73507041062f63646286dea60053da.zip
external_mesa3d-26ac16fe2f73507041062f63646286dea60053da.tar.gz
external_mesa3d-26ac16fe2f73507041062f63646286dea60053da.tar.bz2
i965/eu: Add codegen support for the Gen9+ render target read message.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_eu_emit.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu_emit.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index 8850173..31fe040 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -2408,6 +2408,34 @@ void brw_fb_WRITE(struct brw_codegen *p,
0 /* send_commit_msg */);
}
+brw_inst *
+gen9_fb_READ(struct brw_codegen *p,
+ struct brw_reg dst,
+ struct brw_reg payload,
+ unsigned binding_table_index,
+ unsigned msg_length,
+ unsigned response_length,
+ bool per_sample)
+{
+ const struct brw_device_info *devinfo = p->devinfo;
+ assert(devinfo->gen >= 9);
+ const unsigned msg_subtype =
+ brw_inst_exec_size(devinfo, p->current) == BRW_EXECUTE_16 ? 0 : 1;
+ brw_inst *insn = next_insn(p, BRW_OPCODE_SENDC);
+
+ brw_set_dest(p, insn, dst);
+ brw_set_src0(p, insn, payload);
+ 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,
+ msg_length, true /* header_present */,
+ response_length);
+ brw_inst_set_rt_slot_group(devinfo, insn,
+ brw_inst_qtr_control(devinfo, p->current) / 2);
+
+ return insn;
+}
/**
* Texture sample instruction.