From 3b7f683f3bbbd93e417a6f42ec7c609465be49de Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Mon, 9 Feb 2015 21:11:46 -0800 Subject: i965: Use greater-equal cmod to implement maximum. The docs specifically call out SEL with .l and .ge as the implementations of MIN and MAX respectively. Among other things, SEL with these conditional mods are commutative. Reviewed-by: Ian Romanick --- src/mesa/drivers/dri/i965/brw_fs_visitor.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa/drivers/dri/i965/brw_fs_visitor.cpp') diff --git a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp index 74860711abd..4b48f2db0f2 100644 --- a/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp +++ b/src/mesa/drivers/dri/i965/brw_fs_visitor.cpp @@ -321,6 +321,9 @@ void fs_visitor::emit_minmax(enum brw_conditional_mod conditionalmod, const fs_reg &dst, const fs_reg &src0, const fs_reg &src1) { + assert(conditionalmod == BRW_CONDITIONAL_GE || + conditionalmod == BRW_CONDITIONAL_L); + fs_inst *inst; if (brw->gen >= 6) { @@ -1956,7 +1959,7 @@ fs_visitor::rescale_texcoord(fs_reg coordinate, int coord_components, chan = offset(chan, i); inst = emit(BRW_OPCODE_SEL, chan, chan, fs_reg(0.0f)); - inst->conditional_mod = BRW_CONDITIONAL_G; + inst->conditional_mod = BRW_CONDITIONAL_GE; /* Our parameter comes in as 1.0/width or 1.0/height, * because that's what people normally want for doing -- cgit v1.2.3