Mesa (glsl2): ast_function: Actually do type conversion on function arguments.
Ian Romanick
idr at kemper.freedesktop.org
Thu Jul 15 00:18:23 UTC 2010
Module: Mesa
Branch: glsl2
Commit: 17a307d154489d718ab51a6272d2054868d782f6
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=17a307d154489d718ab51a6272d2054868d782f6
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Wed Jul 14 13:22:07 2010 -0700
ast_function: Actually do type conversion on function arguments.
---
src/glsl/ast_function.cpp | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/glsl/ast_function.cpp b/src/glsl/ast_function.cpp
index 9315a92..467722c 100644
--- a/src/glsl/ast_function.cpp
+++ b/src/glsl/ast_function.cpp
@@ -31,6 +31,9 @@ inline unsigned min(unsigned a, unsigned b)
return (a < b) ? a : b;
}
+static ir_rvalue *
+convert_component(ir_rvalue *src, const glsl_type *desired_type);
+
static unsigned
process_parameters(exec_list *instructions, exec_list *actual_parameters,
exec_list *parameters,
@@ -93,13 +96,15 @@ process_call(exec_list *instructions, ir_function *f,
}
}
+ if (formal->type->is_numeric() || formal->type->is_boolean()) {
+ ir_rvalue *converted = convert_component(actual, formal->type);
+ actual->replace_with(converted);
+ }
+
actual_iter.next();
formal_iter.next();
}
- /* FINISHME: The list of actual parameters needs to be modified to
- * FINISHME: include any necessary conversions.
- */
return new(ctx) ir_call(sig, actual_parameters);
} else {
/* FINISHME: Log a better error message here. G++ will show the types
More information about the mesa-commit
mailing list