From: Michal Krol Date: Thu, 10 Dec 2009 11:59:23 +0000 (+0100) Subject: slang: Predefine ES symbols for FEATURE_es2_glsl. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f00805a11756fa9d2bdfce15f51ae4798d72b5fb;p=mesa.git slang: Predefine ES symbols for FEATURE_es2_glsl. --- diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 00db299a271..478acb89d33 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2610,6 +2610,15 @@ compile_with_grammar(const char *source, return GL_FALSE; } +#if FEATURE_es2_glsl + if (sl_pp_context_add_predefined(context, "GL_ES", "1") || + sl_pp_context_add_predefined(context, "GL_FRAGMENT_PRECISION_HIGH", "1")) { + slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context)); + sl_pp_context_destroy(context); + return GL_FALSE; + } +#endif + memset(&options, 0, sizeof(options)); if (sl_pp_tokenise(context, source, &options, &intokens)) { slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context));