summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2015-02-24 12:48:56 -0800
committerKenneth Graunke <[email protected]>2015-03-19 16:14:51 -0700
commit201aef9d1370ff524f856b725d2328c4f48199e8 (patch)
tree7bd71c90ea89dc85a9c9f3fd0dc43f965ae0bb87
parent8a0946f3b1522e5f91afe14c8c3b22ba6009ed04 (diff)
i965/fp: Emit discard jumps.
This should improve the performance of any shaders using the KIL instruction. I'm a bit surprised we missed this. Unfortunately, I have not been able to measure any performance improvements from this patch. It does make ARB_fragment_program behave similarly to GLSL code. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
-rw-r--r--src/mesa/drivers/dri/i965/brw_fs_fp.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
index 6d08bf7b539..c4064da88a0 100644
--- a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
+++ b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
@@ -250,6 +250,9 @@ fs_visitor::emit_fragment_program_code()
fs_reg(0.0f), BRW_CONDITIONAL_GE));
cmp->predicate = BRW_PREDICATE_NORMAL;
cmp->flag_subreg = 1;
+
+ if (brw->gen >= 6)
+ emit_discard_jump();
}
break;
}