[Mesa-dev] [PATCH 09/23] intel/eu: Use descriptor constructors for pixel interpolator messages.

Francisco Jerez currojerez at riseup.net
Tue Jun 12 02:26:01 UTC 2018


---
 src/intel/compiler/brw_eu.h      | 12 ++++++++++++
 src/intel/compiler/brw_eu_emit.c | 23 ++++++++++-------------
 2 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/src/intel/compiler/brw_eu.h b/src/intel/compiler/brw_eu.h
index f595f5c6726..230be6026be 100644
--- a/src/intel/compiler/brw_eu.h
+++ b/src/intel/compiler/brw_eu.h
@@ -340,6 +340,18 @@ brw_dp_write_desc(const struct gen_device_info *devinfo,
               send_commit_msg << 15);
 }
 
+/**
+ * Construct a message descriptor immediate with the specified pixel
+ * interpolator function controls.
+ */
+static inline uint32_t
+brw_pixel_interp_desc(const struct gen_device_info *devinfo,
+                      unsigned msg_type,
+                      bool noperspective,
+                      unsigned simd_mode) {
+   return msg_type << 12 | !!noperspective << 14 | simd_mode << 16;
+}
+
 void brw_urb_WRITE(struct brw_codegen *p,
 		   struct brw_reg dest,
 		   unsigned msg_reg_nr,
diff --git a/src/intel/compiler/brw_eu_emit.c b/src/intel/compiler/brw_eu_emit.c
index b931d87ccfa..6446a6eaa53 100644
--- a/src/intel/compiler/brw_eu_emit.c
+++ b/src/intel/compiler/brw_eu_emit.c
@@ -3253,24 +3253,21 @@ brw_pixel_interpolator_query(struct brw_codegen *p,
                              unsigned response_length)
 {
    const struct gen_device_info *devinfo = p->devinfo;
-   struct brw_inst *insn;
    const uint16_t exec_size = brw_get_default_exec_size(p);
+   const unsigned simd_mode = (exec_size == BRW_EXECUTE_16);
+   const unsigned desc =
+      brw_message_desc(devinfo, msg_length, response_length, false) |
+      brw_pixel_interp_desc(devinfo, mode, noperspective, simd_mode);
 
    /* brw_send_indirect_message will automatically use a direct send message
     * if data is actually immediate.
     */
-   insn = brw_send_indirect_message(p,
-                                    GEN7_SFID_PIXEL_INTERPOLATOR,
-                                    dest,
-                                    mrf,
-                                    vec1(data), 0);
-   brw_inst_set_mlen(devinfo, insn, msg_length);
-   brw_inst_set_rlen(devinfo, insn, response_length);
-
-   brw_inst_set_pi_simd_mode(devinfo, insn, exec_size == BRW_EXECUTE_16);
-   brw_inst_set_pi_slot_group(devinfo, insn, 0); /* zero unless 32/64px dispatch */
-   brw_inst_set_pi_nopersp(devinfo, insn, noperspective);
-   brw_inst_set_pi_message_type(devinfo, insn, mode);
+   brw_send_indirect_message(p,
+                             GEN7_SFID_PIXEL_INTERPOLATOR,
+                             dest,
+                             mrf,
+                             vec1(data),
+                             desc);
 }
 
 void
-- 
2.16.1



More information about the mesa-dev mailing list