summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-04-23 22:56:25 -0700
committerKenneth Graunke <[email protected]>2015-04-25 09:47:29 -0700
commit19165e3b6eff3a33379af127d27c6585ffbd1028 (patch)
tree6b38df077857f8aaa8fcde9e11dd179da304e212 /src
parent7f5a8ac155283e78df2da5b172a65361a80d38b6 (diff)
i965: Disassemble sampler message names on Gen5+.
Previously, sampler messages were decoded as sampler (1, 0, 2, 2) mlen 6 rlen 8 { align1 1H }; I don't know how much time we've collectly wasted trying to read this format. I can never recall which number is the surface index, sampler index, message type, or...whatever that other number is. Figuring out the message name from the numerical code is also painful. Now they decode as: sampler sample_l SIMD16 Surface = 1 Sampler = 0 mlen 6 rlen 8 { align1 1H }; This is easy to read at a glance, and matches the format I used for render target formats. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i965/brw_disasm.c38
1 files changed, 34 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c
index d1078c07b0d..95e262a361b 100644
--- a/src/mesa/drivers/dri/i965/brw_disasm.c
+++ b/src/mesa/drivers/dri/i965/brw_disasm.c
@@ -579,6 +579,34 @@ static const char *const urb_complete[2] = {
[1] = "complete"
};
+static const char *const gen5_sampler_msg_type[] = {
+ [GEN5_SAMPLER_MESSAGE_SAMPLE] = "sample",
+ [GEN5_SAMPLER_MESSAGE_SAMPLE_BIAS] = "sample_b",
+ [GEN5_SAMPLER_MESSAGE_SAMPLE_LOD] = "sample_l",
+ [GEN5_SAMPLER_MESSAGE_SAMPLE_COMPARE] = "sample_c",
+ [GEN5_SAMPLER_MESSAGE_SAMPLE_DERIVS] = "sample_d",
+ [GEN5_SAMPLER_MESSAGE_SAMPLE_BIAS_COMPARE] = "sample_b_c",
+ [GEN5_SAMPLER_MESSAGE_SAMPLE_LOD_COMPARE] = "sample_l_c",
+ [GEN5_SAMPLER_MESSAGE_SAMPLE_LD] = "ld",
+ [GEN7_SAMPLER_MESSAGE_SAMPLE_GATHER4] = "gather4",
+ [GEN5_SAMPLER_MESSAGE_LOD] = "lod",
+ [GEN5_SAMPLER_MESSAGE_SAMPLE_RESINFO] = "resinfo",
+ [GEN7_SAMPLER_MESSAGE_SAMPLE_GATHER4_C] = "gather4_c",
+ [GEN7_SAMPLER_MESSAGE_SAMPLE_GATHER4_PO] = "gather4_po",
+ [GEN7_SAMPLER_MESSAGE_SAMPLE_GATHER4_PO_C] = "gather4_po_c",
+ [HSW_SAMPLER_MESSAGE_SAMPLE_DERIV_COMPARE] = "sample_d_c",
+ [GEN7_SAMPLER_MESSAGE_SAMPLE_LD_MCS] = "ld_mcs",
+ [GEN7_SAMPLER_MESSAGE_SAMPLE_LD2DMS] = "ld2dms",
+ [GEN7_SAMPLER_MESSAGE_SAMPLE_LD2DSS] = "ld2dss",
+};
+
+static const char *const gen5_sampler_simd_mode[4] = {
+ [BRW_SAMPLER_SIMD_MODE_SIMD4X2] = "SIMD4x2",
+ [BRW_SAMPLER_SIMD_MODE_SIMD8] = "SIMD8",
+ [BRW_SAMPLER_SIMD_MODE_SIMD16] = "SIMD16",
+ [BRW_SAMPLER_SIMD_MODE_SIMD32_64] = "SIMD32/64",
+};
+
static const char *const sampler_target_format[4] = {
[0] = "F",
[2] = "UD",
@@ -1374,11 +1402,13 @@ brw_disassemble_inst(FILE *file, const struct brw_device_info *devinfo,
break;
case BRW_SFID_SAMPLER:
if (devinfo->gen >= 5) {
- format(file, " (%ld, %ld, %ld, %ld)",
+ err |= control(file, "sampler message", gen5_sampler_msg_type,
+ brw_inst_sampler_msg_type(devinfo, inst), &space);
+ err |= control(file, "sampler simd mode", gen5_sampler_simd_mode,
+ brw_inst_sampler_simd_mode(devinfo, inst), &space);
+ format(file, " Surface = %ld Sampler = %ld",
brw_inst_binding_table_index(devinfo, inst),
- brw_inst_sampler(devinfo, inst),
- brw_inst_sampler_msg_type(devinfo, inst),
- brw_inst_sampler_simd_mode(devinfo, inst));
+ brw_inst_sampler(devinfo, inst));
} else {
format(file, " (%ld, %ld, %ld, ",
brw_inst_binding_table_index(devinfo, inst),