i965/fs: When producing ir_unop_abs of an operand, strip negate.
authorEric Anholt <eric@anholt.net>
Wed, 12 Jan 2011 17:37:07 +0000 (09:37 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 12 Jan 2011 17:50:10 +0000 (09:50 -0800)
We were returning the negative absolute value, instead of the absolute
value.  Fixes glsl-fs-abs-neg.

src/mesa/drivers/dri/i965/brw_fs.cpp

index 35bce0f397cecc835db7d3cf99b0fbd37b39187f..f4f938595743b05317a8c0d925154e77d4ff7c4a 100644 (file)
@@ -859,6 +859,7 @@ fs_visitor::visit(ir_expression *ir)
       break;
    case ir_unop_abs:
       op[0].abs = true;
+      op[0].negate = false;
       this->result = op[0];
       break;
    case ir_unop_sign: