[Mesa-dev] [PATCH 4/4] glsl: Add i2b() and b2i() to ir_builder.
Matt Turner
mattst88 at gmail.com
Mon Aug 12 13:25:59 PDT 2013
---
src/glsl/ir_builder.cpp | 12 ++++++++++++
src/glsl/ir_builder.h | 2 ++
2 files changed, 14 insertions(+)
diff --git a/src/glsl/ir_builder.cpp b/src/glsl/ir_builder.cpp
index b47d131..7d9cf5e 100644
--- a/src/glsl/ir_builder.cpp
+++ b/src/glsl/ir_builder.cpp
@@ -369,6 +369,18 @@ bitcast_u2f(operand a)
return expr(ir_unop_bitcast_u2f, a);
}
+ir_expression*
+i2b(operand a)
+{
+ return expr(ir_unop_i2b, a);
+}
+
+ir_expression*
+b2i(operand a)
+{
+ return expr(ir_unop_b2i, a);
+}
+
ir_if*
if_tree(operand condition,
ir_instruction *then_branch)
diff --git a/src/glsl/ir_builder.h b/src/glsl/ir_builder.h
index 267b673..7049476 100644
--- a/src/glsl/ir_builder.h
+++ b/src/glsl/ir_builder.h
@@ -162,6 +162,8 @@ ir_expression *u2f(operand a);
ir_expression *bitcast_u2f(operand a);
ir_expression *i2u(operand a);
ir_expression *u2i(operand a);
+ir_expression *b2i(operand a);
+ir_expression *i2b(operand a);
/**
* Swizzle away later components, but preserve the ordering.
--
1.8.3.2
More information about the mesa-dev
mailing list