summaryrefslogtreecommitdiffstats
path: root/src/glsl/ir.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glsl/ir.cpp')
-rw-r--r--src/glsl/ir.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/glsl/ir.cpp b/src/glsl/ir.cpp
index 2c45b9edc0f..8933b230177 100644
--- a/src/glsl/ir.cpp
+++ b/src/glsl/ir.cpp
@@ -662,6 +662,22 @@ ir_expression::get_operator(const char *str)
return (ir_expression_operation) -1;
}
+ir_variable *
+ir_expression::variable_referenced() const
+{
+ switch (operation) {
+ case ir_binop_vector_extract:
+ case ir_triop_vector_insert:
+ /* We get these for things like a[0] where a is a vector type. In these
+ * cases we want variable_referenced() to return the actual vector
+ * variable this is wrapping.
+ */
+ return operands[0]->variable_referenced();
+ default:
+ return ir_rvalue::variable_referenced();
+ }
+}
+
ir_constant::ir_constant()
: ir_rvalue(ir_type_constant)
{
@@ -1673,8 +1689,8 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
if (type->is_interface())
this->init_interface_type(type);
- else if (type->is_array() && type->fields.array->is_interface())
- this->init_interface_type(type->fields.array);
+ else if (type->without_array()->is_interface())
+ this->init_interface_type(type->without_array());
}
}