summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser.yy
Commit message (Collapse)AuthorAgeFilesLines
* glsl: rename VERSION to VERSION_TOK for automakeMatt Turner2012-01-041-2/+2
| | | | Signed-off-by: Matt Turner <[email protected]>
* glsl: Fix crashes caused by Bison error messages involving "'%'".Kenneth Graunke2011-12-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Invalid shaders containing the character % at an unexpected location would cause Bison to call yyerror with a message of: syntax error, unexpected '%' Bison expects yyerror() to take a string, while _mesa_glsl_error() is a printf-style function. This hit the classic printf string escape issue: _mesa_glsl_error(loc, state, "unexpected '%'"); // invalid! _mesa_glsl_error(loc, state, "%s", "unexpected '%'"); // correct. This caused assertion failures after ralloc_asprintf_append called vsnprintf to determine the length of the text that would be printed: vsnprintf would see the invalid format and return -1, an invalid length. The solution is to define a proper yyerror() wrapper function that calls _mesa_glsl_error with the "%s". Since we compile with -p "_mesa_glsl", yyerror is defined as: #define yyerror _mesa_glsl_error So we have to #undef yyerror in order to be able to declare it. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43564 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Acked-by: Paul Berry <[email protected]>
* glsl: finish up ARB_conservative_depth (v2)Marek Olšák2011-11-221-1/+8
| | | | | | | v2: updated an error message Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add missing ';' in action statement.José Fonseca2011-11-141-1/+1
| | | | | | | Addresses the warnings: warning: a `;' might be needed at the end of action code warning: future versions of Bison will not add the `;'
* glsl: Reference data structure ctors in grammarDan McCabe2011-11-071-16/+39
| | | | | | | | | | | | | | | | | We now tie the grammar to the ctors of the ASTs they reference. This requires that we actually have definitions of the ctors. In addition, we also need to define "print" and "hir" methods for the AST classes. The Print methods are pretty simple to flesh out. However, at this stage of the development, we simply stub out the "hir" methods and flesh them out later. Also, since actual class instances get returned by the productions in the grammar, we also need to designate the type of the productions that reference those instances. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add productions to GLSL grammar for switch statementDan McCabe2011-11-071-3/+61
| | | | | | | | | | | | | The grammar is modified to support switch statements. Rather than follow the grammar in the appendix, which allows case labels to be placed ANYWHERE as a regular statement, we follow the development of the grammar as described in the body of the GLSL spec. In this variation, the switch statement has a body which consists of a list of case statements. A case statement is preceded by a list of case labels and ends with a list of statements. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: add support for GL_OES_EGL_image_externalChia-I Wu2011-11-031-0/+2
| | | | | | | | | | This extension introduces a new sampler type: samplerExternalOES. texture2D (and texture2DProj) can be used to do a texture look up in an external texture. Reviewed-by: Brian Paul <[email protected]> Acked-by: Jakob Bornecrantz <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Implement the GL_ARB_conservative_depth extension.Kenneth Graunke2011-08-251-2/+2
| | | | | | | It's the same as GL_AMD_conservative_depth. The specs have slight differences in wording, but don't differ in content or behavior. Signed-off-by: Kenneth Graunke <[email protected]>
* glsl: empty declarations should be validChia-I Wu2011-08-051-7/+3
| | | | | | | | | | | | | | | Unlike C++, empty declarations such as float; should be valid. The spec is not explicit about this actually. Some apps that generate their shader sources may rely on this. This was noted when porting one of them to Linux from Windows. Reviewed-by: Chad Versace <[email protected]> Note: this is a candidate for the 7.11 branch.
* glsl: Rename .lpp to .ll and .ypp to .yy.Kenneth Graunke2011-03-011-0/+1755
SCons has built-in support for .ll and .yy, but not .lpp and .ypp. Since there's no real benefit to using the old names, change them.