From c9de313f1b6d0ee8d9304fc3fe11fb84ff494f12 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 16 Sep 2009 20:28:20 +0200 Subject: slang: Propagate error messages from preprocessor. --- src/mesa/shader/slang/slang_compile.c | 5 +++++ 1 file changed, 5 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 8ea8675618..19fec53877 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2597,15 +2597,18 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, memset(&options, 0, sizeof(options)); if (sl_pp_purify(source, &options, &outbuf)) { + slang_info_log_error(infolog, "unable to preprocess the source"); return GL_FALSE; } if (sl_pp_context_init(&context)) { + slang_info_log_error(infolog, "out of memory"); free(outbuf); return GL_FALSE; } if (sl_pp_tokenise(&context, outbuf, &intokens)) { + slang_info_log_error(infolog, "%s", context.error_msg); sl_pp_context_destroy(&context); free(outbuf); return GL_FALSE; @@ -2614,12 +2617,14 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, free(outbuf); if (sl_pp_version(&context, intokens, &version, &tokens_eaten)) { + slang_info_log_error(infolog, "%s", context.error_msg); sl_pp_context_destroy(&context); free(intokens); return GL_FALSE; } if (sl_pp_process(&context, &intokens[tokens_eaten], &tokens)) { + slang_info_log_error(infolog, "%s", context.error_msg); sl_pp_context_destroy(&context); free(intokens); return GL_FALSE; -- cgit v1.2.3