[Mesa-dev] [PATCH 2/2] i965/fp: Emit discard jumps.
Kenneth Graunke
kenneth at whitecape.org
Fri Mar 13 14:31:33 PDT 2015
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 <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_fs_fp.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_fs_fp.cpp b/src/mesa/drivers/dri/i965/brw_fs_fp.cpp
index 6d08bf7..c4064da 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;
}
--
2.2.2
More information about the mesa-dev
mailing list