summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/glsl/ast_function.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index c3b4441435f..1a5a193ad50 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -432,8 +432,10 @@ constant_record_constructor(const glsl_type *constructor_type,
exec_list *parameters, void *mem_ctx)
{
foreach_list(node, parameters) {
- if (((ir_instruction *) node)->as_constant() == NULL)
+ ir_constant *constant = ((ir_instruction *) node)->as_constant();
+ if (constant == NULL)
return NULL;
+ node->replace_with(constant);
}
return new(mem_ctx) ir_constant(constructor_type, parameters);