summaryrefslogtreecommitdiff
path: root/ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ir.cpp')
-rw-r--r--ir.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/ir.cpp b/ir.cpp
index 06eb19691e..4c1f307e8a 100644
--- a/ir.cpp
+++ b/ir.cpp
@@ -74,6 +74,34 @@ ir_constant::ir_constant(const struct glsl_type *type, const void *data)
memcpy(& this->value, data, size * type->components());
}
+ir_constant::ir_constant(float f)
+ : ir_rvalue()
+{
+ this->type = glsl_type::float_type;
+ this->value.f[0] = f;
+}
+
+ir_constant::ir_constant(unsigned int u)
+ : ir_rvalue()
+{
+ this->type = glsl_type::uint_type;
+ this->value.u[0] = u;
+}
+
+ir_constant::ir_constant(int i)
+ : ir_rvalue()
+{
+ this->type = glsl_type::int_type;
+ this->value.i[0] = i;
+}
+
+ir_constant::ir_constant(bool b)
+ : ir_rvalue()
+{
+ this->type = glsl_type::bool_type;
+ this->value.b[0] = b;
+}
+
ir_dereference::ir_dereference(ir_instruction *var)
: ir_rvalue()