From: Kenneth Graunke Date: Thu, 2 Sep 2010 02:54:27 +0000 (-0700) Subject: glsl: Convert constant record constructor parameters to ir_constants. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=43a6200f3c3fb29d2e9654a293b2328cd6c0f64f;p=mesa.git glsl: Convert constant record constructor parameters to ir_constants. I'm not sure if this is strictly necessary, but it seems wise. --- 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);