glsl: Convert constant record constructor parameters to ir_constants.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 2 Sep 2010 02:54:27 +0000 (19:54 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 2 Sep 2010 03:39:09 +0000 (20:39 -0700)
I'm not sure if this is strictly necessary, but it seems wise.

src/glsl/ast_function.cpp

index c3b4441435fdce54f3cf4affb335e0e891b62d0c..1a5a193ad50ea33c5d8bf40522db3803ca90306c 100644 (file)
@@ -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);