summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/opt_constant_propagation.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/glsl/opt_constant_propagation.cpp')
-rw-r--r--src/compiler/glsl/opt_constant_propagation.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/glsl/opt_constant_propagation.cpp b/src/compiler/glsl/opt_constant_propagation.cpp
index 40395120974..52e3937bb11 100644
--- a/src/compiler/glsl/opt_constant_propagation.cpp
+++ b/src/compiler/glsl/opt_constant_propagation.cpp
@@ -154,7 +154,8 @@ ir_constant_propagation_visitor::constant_folding(ir_rvalue **rvalue)
ir_dereference_variable *var_ref = (*rvalue)->as_dereference_variable();
if (var_ref && !var_ref->type->is_array()) {
- ir_constant *constant = var_ref->constant_expression_value();
+ ir_constant *constant =
+ var_ref->constant_expression_value(ralloc_parent(var_ref));
if (constant) {
*rvalue = constant;
this->progress = true;