From a49a865cf53dad5734ca7019406e4ce89702a08f Mon Sep 17 00:00:00 2001 From: Brian Date: Tue, 13 Mar 2007 15:55:41 -0600 Subject: better error msg for undefined function, disable some debug output --- src/mesa/shader/slang/slang_codegen.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/mesa/shader/slang/slang_codegen.c') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 5b5de07b4f..45868c725d 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -1074,7 +1074,7 @@ _slang_gen_function_call(slang_assemble_ctx *A, slang_function *fun, slang_operation_construct(oper); slang_operation_copy(oper, inlined); #else - *oper = *inlined; + *oper = *inlined; /* XXX slang_operation_copy() */ #endif @@ -1280,7 +1280,7 @@ _slang_gen_function_call_name(slang_assemble_ctx *A, const char *name, */ fun = _slang_first_function(A->space.funcs, name); if (!_slang_adapt_call(oper, fun, &A->space, A->atoms, A->log)) { - slang_info_log_error(A->log, "Undefined function '%s'", name); + slang_info_log_error(A->log, "Function '%s' not found (check argument types)", name); return NULL; } assert(fun); @@ -2739,10 +2739,8 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) return GL_TRUE; /* not an error */ } -#if 1 - printf("\n*********** codegen_function %s\n", (char *) fun->header.a_name); -#endif #if 0 + printf("\n*********** codegen_function %s\n", (char *) fun->header.a_name); slang_print_function(fun, 1); #endif @@ -2754,6 +2752,11 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) /* fold constant expressions, etc. */ _slang_simplify(fun->body, &A->space, A->atoms); +#if 0 + printf("\n*********** simplified %s\n", (char *) fun->header.a_name); + slang_print_function(fun, 1); +#endif + /* Create an end-of-function label */ A->curFuncEndLabel = _slang_label_new("__endOfFunc__main"); @@ -2787,7 +2790,7 @@ _slang_codegen_function(slang_assemble_ctx * A, slang_function * fun) printf("************* IR for %s *******\n", (char*)fun->header.a_name); slang_print_ir(n, 0); #endif -#if 1 +#if 0 printf("************* End codegen function ************\n\n"); #endif -- cgit v1.2.3