summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/slang/slang_compile.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2008-11-24 17:18:56 -0700
committerBrian Paul <[email protected]>2008-11-24 17:18:56 -0700
commit8d95e66cf78921cd067c4bcf6a1053a7ec3a2ed4 (patch)
treee0353699e7ce0f65167d0d89a94621a220220d2b /src/mesa/shader/slang/slang_compile.c
parent0fab514ff5e7887767936427b5e02b676abebf3a (diff)
mesa: added support for GLSL 1.20 array.length() method
This is the only method supported in GLSL 1.20 so we take a few short-cuts.
Diffstat (limited to 'src/mesa/shader/slang/slang_compile.c')
-rw-r--r--src/mesa/shader/slang/slang_compile.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index eadc37f5150..efae4e98fbe 100644
--- a/src/mesa/shader/slang/slang_compile.c
+++ b/src/mesa/shader/slang/slang_compile.c
@@ -944,6 +944,7 @@ parse_fully_specified_type(slang_parse_ctx * C, slang_output_ctx * O,
#define OP_POSTINCREMENT 60
#define OP_POSTDECREMENT 61
#define OP_PRECISION 62
+#define OP_METHOD 63
/**
@@ -1389,6 +1390,35 @@ parse_expression(slang_parse_ctx * C, slang_output_ctx * O,
if (!handle_nary_expression(C, op, &ops, &num_ops, 2))
RETURN0;
break;
+ case OP_METHOD:
+ printf("******* begin OP_METHOD\n");
+ op->type = SLANG_OPER_METHOD;
+ op->a_obj = parse_identifier(C);
+ if (op->a_obj == SLANG_ATOM_NULL)
+ RETURN0;
+
+ op->a_id = parse_identifier(C);
+ if (op->a_id == SLANG_ATOM_NULL)
+ RETURN0;
+
+ while (*C->I != OP_END)
+ if (!parse_child_operation(C, O, op, 0))
+ RETURN0;
+ C->I++;
+#if 0
+ /* don't lookup the method (not yet anyway) */
+ if (!C->parsing_builtin
+ && !slang_function_scope_find_by_name(O->funs, op->a_id, 1)) {
+ const char *id;
+
+ id = slang_atom_pool_id(C->atoms, op->a_id);
+ if (!is_constructor_name(id, op->a_id, O->structs)) {
+ slang_info_log_error(C->L, "%s: undeclared function name.", id);
+ RETURN0;
+ }
+ }
+#endif
+ break;
case OP_CALL:
op->type = SLANG_OPER_CALL;
op->a_id = parse_identifier(C);