From 06f2139b8285d9f8a3a33b633d14dde48e0112fe Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 24 Nov 2008 17:18:56 -0700 Subject: 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) --- src/mesa/shader/slang/slang_compile.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/mesa/shader/slang/slang_compile.c') 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); -- cgit v1.2.3