glcpp: Honor the GL context's DisableGLSLLineContinuations option
authorCarl Worth <cworth@cworth.org>
Wed, 5 Dec 2012 21:25:48 +0000 (13:25 -0800)
committerCarl Worth <cworth@cworth.org>
Fri, 11 Jan 2013 21:55:41 +0000 (13:55 -0800)
And simply don't call into the function that removes line continuations.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/glcpp/pp.c

index 5f86a499cd42fc6143e0832e7f5e23c665d3b20c..3f336488ccbe72d563d84dcf928c4e38dc23dded 100644 (file)
@@ -155,7 +155,9 @@ glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log,
 {
        int errors;
        glcpp_parser_t *parser = glcpp_parser_create (extensions, gl_ctx->API);
-       *shader = remove_line_continuations(parser, *shader);
+
+       if (! gl_ctx->Const.DisableGLSLLineContinuations)
+               *shader = remove_line_continuations(parser, *shader);
 
        glcpp_lex_set_source_string (parser, *shader);