diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2008-11-24 17:18:56 -0700 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-01-06 09:00:35 -0700 |
commit | 06f2139b8285d9f8a3a33b633d14dde48e0112fe (patch) | |
tree | 005503af8bf8a3116a3ba5bb13ccaa9f1656de21 /src/mesa/shader/slang/slang_compile.c | |
parent | d450ede4c41915f9e07d9881236d3ad0c435a19f (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.
(cherry picked from commit 8d95e66cf78921cd067c4bcf6a1053a7ec3a2ed4)
Diffstat (limited to 'src/mesa/shader/slang/slang_compile.c')
-rw-r--r-- | src/mesa/shader/slang/slang_compile.c | 30 |
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 eadc37f515..efae4e98fb 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); |