aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/compiler/brw_eu.h
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2018-06-02 15:15:15 -0700
committerFrancisco Jerez <[email protected]>2018-07-09 23:46:57 -0700
commit27c211e30f92a0bf85bd03aab8f5e5de7d094a22 (patch)
tree8966e70c21f2f294fcb624708c980ae3c26457a9 /src/intel/compiler/brw_eu.h
parent1c90ae5accc284cf6b27bcc25e5e3fc3cfb80407 (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.h')
-rw-r--r--src/intel/compiler/brw_eu.h37
1 files changed, 26 insertions, 11 deletions
diff --git a/src/intel/compiler/brw_eu.h b/src/intel/compiler/brw_eu.h
index d128108ff7e..08284766725 100644
--- a/src/intel/compiler/brw_eu.h
+++ b/src/intel/compiler/brw_eu.h
@@ -245,17 +245,6 @@ ROUND(RNDE)
/* Helpers for SEND instruction:
*/
-void brw_set_sampler_message(struct brw_codegen *p,
- brw_inst *insn,
- unsigned binding_table_index,
- unsigned sampler,
- unsigned msg_type,
- unsigned response_length,
- unsigned msg_length,
- unsigned header_present,
- unsigned simd_mode,
- unsigned return_format);
-
void brw_set_dp_read_message(struct brw_codegen *p,
brw_inst *insn,
unsigned binding_table_index,
@@ -299,6 +288,32 @@ brw_message_desc(const struct gen_device_info *devinfo,
}
}
+/**
+ * Construct a message descriptor immediate with the specified sampler
+ * function controls.
+ */
+static inline uint32_t
+brw_sampler_desc(const struct gen_device_info *devinfo,
+ unsigned binding_table_index,
+ unsigned sampler,
+ unsigned msg_type,
+ unsigned simd_mode,
+ unsigned return_format)
+{
+ const unsigned desc = (SET_BITS(binding_table_index, 7, 0) |
+ SET_BITS(sampler, 11, 8));
+ if (devinfo->gen >= 7)
+ return (desc | SET_BITS(msg_type, 16, 12) |
+ SET_BITS(simd_mode, 18, 17));
+ else if (devinfo->gen >= 5)
+ return (desc | SET_BITS(msg_type, 15, 12) |
+ SET_BITS(simd_mode, 17, 16));
+ else if (devinfo->is_g4x)
+ return desc | SET_BITS(msg_type, 15, 12);
+ else
+ return (desc | SET_BITS(return_format, 13, 12) |
+ SET_BITS(msg_type, 15, 14));
+}
void brw_urb_WRITE(struct brw_codegen *p,
struct brw_reg dest,