diff options
author | Matt Turner <mattst88@gmail.com> | 2016-03-12 20:43:45 -0800 |
---|---|---|
committer | Matt Turner <mattst88@gmail.com> | 2016-05-03 23:03:18 -0700 |
commit | f88fcb28a3e16e9e497a5829af04f8c7309a7a21 (patch) | |
tree | 961495730423292a83a2607037e1a5b2e968ba73 | |
parent | 6472687c737e4aa8dc1ecb3300947a4edb6800f6 (diff) |
i965/fs/skl+: Recognize sample_c_lz.wip/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 fc02ed642cc6..ba223631e44a 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -1639,6 +1639,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 4c7fe506d708..5d257743f7ee 100644 --- a/src/mesa/drivers/dri/i965/brw_disasm.c +++ b/src/mesa/drivers/dri/i965/brw_disasm.c @@ -551,6 +551,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 18002c24502a..dfa6a0df8a75 100644 --- a/src/mesa/drivers/dri/i965/brw_fs.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs.cpp @@ -2524,9 +2524,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. */ @@ -2534,7 +2531,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 a3a3b48e9302..5867a4815f9d 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_generator.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_generator.cpp @@ -794,7 +794,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; |