Mesa (master): glsl: Convert constant record constructor parameters to ir_constants.

Kenneth Graunke kwg at kemper.freedesktop.org
Thu Sep 2 03:40:10 UTC 2010


Module: Mesa
Branch: master
Commit: 43a6200f3c3fb29d2e9654a293b2328cd6c0f64f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=43a6200f3c3fb29d2e9654a293b2328cd6c0f64f

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Sep  1 19:54:27 2010 -0700

glsl: Convert constant record constructor parameters to ir_constants.

I'm not sure if this is strictly necessary, but it seems wise.

---

 src/glsl/ast_function.cpp |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index c3b4441..1a5a193 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);




More information about the mesa-commit mailing list