Mesa (glsl2): glsl2: Add some comments.
Kenneth Graunke
kwg at kemper.freedesktop.org
Thu Jul 22 00:21:28 UTC 2010
Module: Mesa
Branch: glsl2
Commit: 0048c7aef82b17c6bd160f49125a91a70cbf2b55
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0048c7aef82b17c6bd160f49125a91a70cbf2b55
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Mon Jul 19 23:45:23 2010 -0700
glsl2: Add some comments.
---
src/glsl/ast_function.cpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index 2348bdf..1122521 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -164,6 +164,9 @@ match_function_by_name(exec_list *instructions, const char *name,
/**
* Perform automatic type conversion of constructor parameters
+ *
+ * This implements the rules in the "Conversion and Scalar Constructors"
+ * section (GLSL 1.10 section 5.4.1), not the "Implicit Conversions" rules.
*/
static ir_rvalue *
convert_component(ir_rvalue *src, const glsl_type *desired_type)
@@ -220,11 +223,11 @@ convert_component(ir_rvalue *src, const glsl_type *desired_type)
assert(result != NULL);
+ /* Try constant folding; it may fold in the conversion we just added. */
ir_constant *const constant = result->constant_expression_value();
return (constant != NULL) ? (ir_rvalue *) constant : (ir_rvalue *) result;
}
-
/**
* Dereference a specific component from a scalar, vector, or matrix
*/
More information about the mesa-commit
mailing list