Mesa (glsl-pp-rework-2): slang: Predefine ES symbols for FEATURE_es2_glsl.

Michał Król michal at kemper.freedesktop.org
Thu Dec 10 11:59:45 UTC 2009


Module: Mesa
Branch: glsl-pp-rework-2
Commit: f00805a11756fa9d2bdfce15f51ae4798d72b5fb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f00805a11756fa9d2bdfce15f51ae4798d72b5fb

Author: Michal Krol <michal at vmware.com>
Date:   Thu Dec 10 12:59:23 2009 +0100

slang: Predefine ES symbols for FEATURE_es2_glsl.

---

 src/mesa/shader/slang/slang_compile.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c
index 00db299..478acb8 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));




More information about the mesa-commit mailing list