summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-07-01 10:37:11 -0700
committerEric Anholt <[email protected]>2010-07-01 11:07:22 -0700
commitd925c9173009e9e5d48df30b30aaef22753183aa (patch)
treee42ee590b44d75b69fb67ee7de8b42ce05ee1c11 /src/mesa
parent5e4dd061d17563828bcce5525400a0ce363aa15d (diff)
glsl2: Add ir_unop_fract as an expression type.
Most backends will prefer seeing this to seeing (a - floor(a)), so represent it explicitly.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/shader/ir_to_mesa.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp
index b270e2da413..2f2096ef97b 100644
--- a/src/mesa/shader/ir_to_mesa.cpp
+++ b/src/mesa/shader/ir_to_mesa.cpp
@@ -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;