summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ir.cpp8
-rw-r--r--ir.h2
2 files changed, 10 insertions, 0 deletions
diff --git a/ir.cpp b/ir.cpp
index 63135e3553..7ada145d53 100644
--- a/ir.cpp
+++ b/ir.cpp
@@ -246,6 +246,14 @@ ir_dereference::ir_dereference(ir_instruction *var,
this->selector.array_index = array_index;
}
+ir_dereference::ir_dereference(ir_instruction *variable, const char *field)
+ : mode(ir_reference_record), var(variable)
+{
+ this->selector.field = field;
+ this->type = (var != NULL)
+ ? var->type->field_type(field) : glsl_type::error_type;
+}
+
bool
ir_dereference::is_lvalue()
{
diff --git a/ir.h b/ir.h
index 42e8264d41..b3fb06d2c7 100644
--- a/ir.h
+++ b/ir.h
@@ -749,6 +749,8 @@ public:
ir_dereference(ir_instruction *variable, ir_rvalue *array_index);
+ ir_dereference(ir_instruction *variable, const char *field);
+
virtual ir_dereference *as_dereference()
{
return this;