aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/glsl/ast_function.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-01-22 13:05:58 +0000
committermarha <marha@users.sourceforge.net>2011-01-22 13:05:58 +0000
commitb8ffa56f8bda74a402eae0c89aadfda7b7db507f (patch)
tree33fb63493b21297286af67eadb21586ca9c20f41 /mesalib/src/glsl/ast_function.cpp
parentb0be6a88c8fecdf15176f642c0799bff99930e0d (diff)
downloadvcxsrv-b8ffa56f8bda74a402eae0c89aadfda7b7db507f.tar.gz
vcxsrv-b8ffa56f8bda74a402eae0c89aadfda7b7db507f.tar.bz2
vcxsrv-b8ffa56f8bda74a402eae0c89aadfda7b7db507f.zip
mesalib git update 22/1/2011
Diffstat (limited to 'mesalib/src/glsl/ast_function.cpp')
-rw-r--r--mesalib/src/glsl/ast_function.cpp27
1 files changed, 21 insertions, 6 deletions
diff --git a/mesalib/src/glsl/ast_function.cpp b/mesalib/src/glsl/ast_function.cpp
index 2e1a4d9f6..02261d68f 100644
--- a/mesalib/src/glsl/ast_function.cpp
+++ b/mesalib/src/glsl/ast_function.cpp
@@ -145,12 +145,27 @@ match_function_by_name(exec_list *instructions, const char *name,
if ((formal->mode == ir_var_out)
|| (formal->mode == ir_var_inout)) {
- if (! actual->is_lvalue()) {
- /* FINISHME: Log a better diagnostic here. There is no way
- * FINISHME: to tell the user which parameter is invalid.
- */
- _mesa_glsl_error(loc, state, "`%s' parameter is not lvalue",
- (formal->mode == ir_var_out) ? "out" : "inout");
+ const char *mode = NULL;
+ switch (formal->mode) {
+ case ir_var_out: mode = "out"; break;
+ case ir_var_inout: mode = "inout"; break;
+ default: assert(false); break;
+ }
+ /* FIXME: 'loc' is incorrect (as of 2011-01-21). It is always
+ * FIXME: 0:0(0).
+ */
+ if (actual->variable_referenced()
+ && actual->variable_referenced()->read_only) {
+ _mesa_glsl_error(loc, state,
+ "function parameter '%s %s' references the "
+ "read-only variable '%s'",
+ mode, formal->name,
+ actual->variable_referenced()->name);
+
+ } else if (!actual->is_lvalue()) {
+ _mesa_glsl_error(loc, state,
+ "function parameter '%s %s' is not an lvalue",
+ mode, formal->name);
}
}