summaryrefslogtreecommitdiffstats
path: root/src/glsl/glcpp/glcpp.h
Commit message (Collapse)AuthorAgeFilesLines
* glsl: glcpp: Move handling of #line directives from lexer to parser.Carl Worth2012-06-261-0/+5
| | | | | | | | | | | | | | | | | | | The GLSL specification requires that #line directives be interpreted after macro expansion. Our existing implementation of #line macros in the lexer prevents conformance on this point. Moving the handling of #line from the lexer to the parser gives us the macro expansion we need. An additional benefit is that the preprocessor also now supports comments on the same line as #line directives. Finally, the preprocessor now emits the (fully-macro-expanded) #line directives into the output. This allows the full GLSL compiler to also see and interpret these directives so it can also generate correct line numbers in error messages. Signed-off-by: Carl Worth <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glcpp: Don't strlen() the output for every token being printed.Kenneth Graunke2012-02-281-0/+2
| | | | | | | | | | | | | The ralloc string appending functions were originally intended for simple, non-hot-path uses like printing to an info log. Cuts Unigine Tropics load time by around 20% (6 seconds). v2: Avoid strlen() on every newline, too. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> [v1] Acked-by: José Fonseca <[email protected]> [v1]
* Convert everything from the talloc API to the ralloc API.Kenneth Graunke2011-01-311-2/+2
|
* glsl: Define GL_ES preprocessor macro if API is OpenGL ES 2.0.Kenneth Graunke2010-09-071-2/+2
| | | | Also define it if #version 100 is encountered.
* glcpp: Remove xtalloc wrappers in favor of plain talloc.Kenneth Graunke2010-08-041-24/+0
| | | | | | Calling exit() on a memory failure probably made sense for the standalone preprocessor, but doesn't seem too appealing as part of the GL library. Also, we don't use it in the main compiler.
* glsl2: Give the path within src/mesa/ for headers instead of relying on -I.Aras Pranckevicius2010-08-021-1/+1
|
* glsl: Fix missing initialization of yylloc.sourceCarl Worth2010-07-211-0/+19
| | | | | | | | | | | | In both the preprocessor and in the compiler proper, we use a custom yyltype struct to allow tracking the source-string number in addition to line and column. However, we were previously relying on bison's default initialization of the yyltype struct which of course is not aware of the source field and leaves it uninitialized. We fix this by defining our own YYLLOC_DEFAULT macro expanding on the default version (as appears in the bison manual) and adding initialization of yylloc.source.
* glsl2: Conditionally define preprocessor tokens for optional extensionsIan Romanick2010-07-011-2/+5
| | | | | The only optional extension currently supported by the compiler is GL_EXT_texture_array.
* glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt2010-06-241-0/+224