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

Author: Michal Krol <mic...@vmware.com>
Date:   Fri Nov 13 19:51:49 2009 +0100

glsl/apps: Report syntax parser errors.

---

 src/glsl/apps/compile.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/glsl/apps/compile.c b/src/glsl/apps/compile.c
index f99d141..edc4265 100644
--- a/src/glsl/apps/compile.c
+++ b/src/glsl/apps/compile.c
@@ -170,7 +170,7 @@ main(int argc,
    }
    outtokens[j] = outtokens[i];
 
-   if (sl_cl_compile(context, outtokens, shader_type, &outbytes, &cboutbytes) 
== 0) {
+   if (sl_cl_compile(context, outtokens, shader_type, 1, &outbytes, 
&cboutbytes, errmsg, sizeof(errmsg)) == 0) {
       unsigned int i;
       unsigned int line = 0;
 
@@ -203,6 +203,9 @@ main(int argc,
       }
       fprintf (out, "\n");
       free(outbytes);
+   } else {
+      fprintf(out, "$SYNTAXERROR: `%s'\n", errmsg);
+      return -1;
    }
 
    sl_pp_context_destroy(context);

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to