diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2014-03-11 17:11:36 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2014-03-14 13:17:57 -0700 |
commit | 4d2e79269a97c403a6384e0f5164b9f54b6a5f61 (patch) | |
tree | 7323490d501a4f91f7a076fbd2dddf091be41c58 /src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp | |
parent | 2dbebbd37d470a1270e6cdd8a45c583dbd4de252 (diff) | |
download | external_mesa3d-4d2e79269a97c403a6384e0f5164b9f54b6a5f61.zip external_mesa3d-4d2e79269a97c403a6384e0f5164b9f54b6a5f61.tar.gz external_mesa3d-4d2e79269a97c403a6384e0f5164b9f54b6a5f61.tar.bz2 |
i965/fs: Fix register comparisons in saturate propagation.
opt_saturate_propagation_local compares scan_inst->dst.reg/reg_offset
with inst->src[0].reg/reg_offset, and ensures that scan_inst->dst.file
is GRF. But nothing ensured that inst->src[0].file was GRF.
In the following program, this resulted in u1:F matching vgrf1:UW,
and a saturate being incorrectly propagated from instruction 8 to
instruction 1.
{ 1} 0: add vgrf0:UW, hw_reg1+8:UW, hw_reg0:V
{ 1} 1: add vgrf1:UW, hw_reg1+10:UW, hw_reg0:V
{ 1} 2: linterp vgrf6:F, hw_reg2:F, hw_reg3:F, hw_reg0:F
{ 2} 3: linterp vgrf27:F, hw_reg2:F, hw_reg3:F, hw_reg0+16:F
{ 4} 4: mov vgrf10+0.0:F, vgrf6:F
{ 3} 5: mov vgrf10+1.0:F, vgrf27:F
{ 6} 6: tex vgrf8+0.0:F, vgrf10+0.0:F
{ 5} 7: mov vgrf32:F, u1:F
{ 5} 8: mov.sat vgrf12:F, u1:F
From shader-db:
total instructions in shared programs: 1841932 -> 1841957 (0.00%)
instructions in affected programs: 5823 -> 5848 (0.43%)
I inspected two of the 25 hurt shaders, and concluded that they were
both hitting this bug, and not legitimately optimized.
This fixes bugs in Left 4 Dead 2 and Team Fortress 2, possibly among
others. The optimization pass didn't exist in 10.0, so this is only
a candidate for 10.1.
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp b/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp index 9c2e451..189888e 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_saturate_propagation.cpp @@ -41,6 +41,7 @@ opt_saturate_propagation_local(fs_visitor *v, bblock_t *block) if (inst->opcode != BRW_OPCODE_MOV || inst->dst.file != GRF || + inst->src[0].file != GRF || !inst->saturate) continue; |