glsl2: Add ir_unop_fract as an expression type.

Most backends will prefer seeing this to seeing (a - floor(a)), so
represent it explicitly.
This commit is contained in:
Eric Anholt
2010-07-01 10:37:11 -07:00
parent 5e4dd061d1
commit d925c91730
6 changed files with 33 additions and 8 deletions

View File

@@ -782,6 +782,10 @@ ir_to_mesa_visitor::visit(ir_expression *ir)
case ir_unop_floor:
ir_to_mesa_emit_op1(ir, OPCODE_FLR, result_dst, op[0]);
break;
case ir_unop_fract:
ir_to_mesa_emit_op1(ir, OPCODE_FRC, result_dst, op[0]);
break;
case ir_binop_min:
ir_to_mesa_emit_op2(ir, OPCODE_MIN, result_dst, op[0], op[1]);
break;