diff options
author | Matt Turner <mattst88@gmail.com> | 2016-03-12 20:43:45 -0800 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2016-05-19 16:42:03 -0700 |
commit | f05eead33ed75d11354687d816e4cdb298cc082a (patch) | |
tree | 0f821d45f51786bd71eade40ae60814f105d1cf7 | |
parent | 100899008e34b15b43b95f28e82a5b949e4fdb9a (diff) |
i965/fs/skl+: Recognize sample_c_lz.experiment/sample_lz
total instructions in shared programs: 8508434 -> 8505467 (-0.03%)
instructions in affected programs: 84569 -> 81602 (-3.51%)
helped: 231
total cycles in shared programs: 64154656 -> 64105302 (-0.08%)
cycles in affected programs: 524474 -> 475120 (-9.41%)
helped: 183
HURT: 48
total spills in shared programs: 1688 -> 1683 (-0.30%)
spills in affected programs: 17 -> 12 (-29.41%)
helped: 1
total fills in shared programs: 2619 -> 2606 (-0.50%)
fills in affected programs: 38 -> 25 (-34.21%)
helped: 1
GAINED: 31
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_defines.h | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_disasm.c | 1 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs.cpp | 5 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_generator.cpp | 6 |
4 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 82cac7b0e3f..089eded7402 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -1648,6 +1648,7 @@ enum brw_message_target { #define GEN7_SAMPLER_MESSAGE_SAMPLE_GATHER4_PO_C 18 #define HSW_SAMPLER_MESSAGE_SAMPLE_DERIV_COMPARE 20 #define GEN9_SAMPLER_MESSAGE_SAMPLE_LZ 24 +#define GEN9_SAMPLER_MESSAGE_SAMPLE_C_LZ 25 #define GEN9_SAMPLER_MESSAGE_SAMPLE_LD_LZ 26 #define GEN9_SAMPLER_MESSAGE_SAMPLE_LD2DMS_W 28 #define GEN7_SAMPLER_MESSAGE_SAMPLE_LD_MCS 29 diff --git a/src/mesa/drivers/dri/i965/brw_disasm.c b/src/mesa/drivers/dri/i965/brw_disasm.c index 64f5fe89554..068c120acc7 100644 --- a/src/mesa/drivers/dri/i965/brw_disasm.c +++ b/src/mesa/drivers/dri/i965/brw_disasm.c @@ -552,6 +552,7 @@ static const char *const gen5_sampler_msg_type[] = { [GEN7_SAMPLER_MESSAGE_SAMPLE_GATHER4_PO_C] = "gather4_po_c", [HSW_SAMPLER_MESSAGE_SAMPLE_DERIV_COMPARE] = "sample_d_c", [GEN9_SAMPLER_MESSAGE_SAMPLE_LZ] = "sample_lz", + [GEN9_SAMPLER_MESSAGE_SAMPLE_C_LZ] = "sample_c_lz", [GEN9_SAMPLER_MESSAGE_SAMPLE_LD_LZ] = "ld_lz", [GEN9_SAMPLER_MESSAGE_SAMPLE_LD2DMS_W] = "ld2dms_w", [GEN7_SAMPLER_MESSAGE_SAMPLE_LD_MCS] = "ld_mcs", diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp index 2eb6c56ec96..c5cfa6bdac2 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2617,9 +2617,6 @@ fs_visitor::opt_sample_lz() inst->opcode != SHADER_OPCODE_TXL) continue; - if (inst->shadow_compare) - continue; - /* If the LOD parameter is not sent or is a constant zero then we can * change the instruction. */ @@ -2627,7 +2624,7 @@ fs_visitor::opt_sample_lz() if (inst->opcode == SHADER_OPCODE_TXF) { lod_offset = 2; } else if (inst->opcode == SHADER_OPCODE_TXL) { - lod_offset = 0; + lod_offset = inst->shadow_compare ? 1 : 0; } else { unreachable("not reached"); } diff --git a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp index 383b0740126..368861725c9 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -783,7 +783,11 @@ fs_generator::generate_tex(fs_inst *inst, struct brw_reg dst, struct brw_reg src break; case SHADER_OPCODE_TXL_LZ: assert(devinfo->gen >= 9); - msg_type = GEN9_SAMPLER_MESSAGE_SAMPLE_LZ; + if (inst->shadow_compare) { + msg_type = GEN9_SAMPLER_MESSAGE_SAMPLE_C_LZ; + } else { + msg_type = GEN9_SAMPLER_MESSAGE_SAMPLE_LZ; + } break; case SHADER_OPCODE_TXS: msg_type = GEN5_SAMPLER_MESSAGE_SAMPLE_RESINFO; |