i965: add low-level support for send to pixel interpolator
authorChris Forbes <chrisf@ijw.co.nz>
Sun, 17 Nov 2013 08:47:22 +0000 (21:47 +1300)
committerChris Forbes <chrisf@ijw.co.nz>
Sat, 12 Jul 2014 22:01:17 +0000 (10:01 +1200)
Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_emit.c

index 3164c80897daf95fd8f9d2a0c579bcb0c623f09c..63cb20b1a55968a48acfde823b9bc0d9e2bd3755 100644 (file)
@@ -372,6 +372,16 @@ brw_untyped_surface_read(struct brw_compile *p,
                          unsigned msg_length,
                          unsigned response_length);
 
+void
+brw_pixel_interpolator_query(struct brw_compile *p,
+                             struct brw_reg dest,
+                             struct brw_reg mrf,
+                             bool noperspective,
+                             unsigned mode,
+                             unsigned data,
+                             unsigned msg_length,
+                             unsigned response_length);
+
 /***********************************************************************
  * brw_eu_util.c:
  */
index 3f00e4dc4a02580982d2efe98aec5f72a11cc875..12424bde833ec3afb800eecac1e39cf03c4ccb1b 100644 (file)
@@ -2633,6 +2633,34 @@ brw_untyped_surface_read(struct brw_compile *p,
       brw_inst_access_mode(brw, insn) == BRW_ALIGN_1);
 }
 
+void
+brw_pixel_interpolator_query(struct brw_compile *p,
+                             struct brw_reg dest,
+                             struct brw_reg mrf,
+                             bool noperspective,
+                             unsigned mode,
+                             unsigned data,
+                             unsigned msg_length,
+                             unsigned response_length)
+{
+   const struct brw_context *brw = p->brw;
+   struct brw_inst *insn = next_insn(p, BRW_OPCODE_SEND);
+
+   brw_set_dest(p, insn, dest);
+   brw_set_src0(p, insn, mrf);
+   brw_set_message_descriptor(p, insn, GEN7_SFID_PIXEL_INTERPOLATOR,
+                              msg_length, response_length,
+                              false /* header is never present for PI */,
+                              false);
+
+   brw_inst_set_pi_simd_mode(
+         brw, insn, brw_inst_exec_size(brw, insn) == BRW_EXECUTE_16);
+   brw_inst_set_pi_slot_group(brw, insn, 0); /* zero unless 32/64px dispatch */
+   brw_inst_set_pi_nopersp(brw, insn, noperspective);
+   brw_inst_set_pi_message_type(brw, insn, mode);
+   brw_inst_set_pi_message_data(brw, insn, data);
+}
+
 /**
  * This instruction is generated as a single-channel align1 instruction by
  * both the VS and FS stages when using INTEL_DEBUG=shader_time.