Mesa (master): glsl: Add trunc() to ir_builder.

Matt Turner mattst88 at kemper.freedesktop.org
Wed Feb 11 22:38:55 UTC 2015


Module: Mesa
Branch: master
Commit: a5455ab1cae85dbe40c12ada9030bc4b4537ced7
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a5455ab1cae85dbe40c12ada9030bc4b4537ced7

Author: Matt Turner <mattst88 at gmail.com>
Date:   Fri Jan 30 13:50:28 2015 -0800

glsl: Add trunc() to ir_builder.

---

 src/glsl/ir_builder.cpp |    5 +++++
 src/glsl/ir_builder.h   |    1 +
 2 files changed, 6 insertions(+)

diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp
index a2f6f29..2872c51 100644
--- a/src/glsl/ir_builder.cpp
+++ b/src/glsl/ir_builder.cpp
@@ -246,6 +246,11 @@ ir_expression *borrow(operand a, operand b)
    return expr(ir_binop_borrow, a, b);
 }
 
+ir_expression *trunc(operand a)
+{
+   return expr(ir_unop_trunc, a);
+}
+
 ir_expression *round_even(operand a)
 {
    return expr(ir_unop_round_even, a);
diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h
index 573596c..514275e 100644
--- a/src/glsl/ir_builder.h
+++ b/src/glsl/ir_builder.h
@@ -137,6 +137,7 @@ ir_expression *imul_high(operand a, operand b);
 ir_expression *div(operand a, operand b);
 ir_expression *carry(operand a, operand b);
 ir_expression *borrow(operand a, operand b);
+ir_expression *trunc(operand a);
 ir_expression *round_even(operand a);
 ir_expression *dot(operand a, operand b);
 ir_expression *clamp(operand a, operand b, operand c);




More information about the mesa-commit mailing list