summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_lexer.lpp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Support the 'invariant(all)' pragmaIan Romanick2011-01-061-0/+4
| | | | | | | | | | | | | Previously the 'STDGL invariant(all)' pragma added in GLSL 1.20 was simply ignored by the compiler. This adds support for setting all variable invariant. In GLSL 1.10 and GLSL ES 1.00 the pragma is ignored, per the specs, but a warning is generated. Fixes piglit test glsl-invariant-pragma and bugzilla #31925. NOTE: This is a candidate for the 7.9 and 7.10 branches.
* glsl: new glsl_strtod() wrapper to fix decimal point interpretationBrian Paul2010-12-141-5/+6
| | | | | | | | We always want to use '.' as the decimal point. See http://bugs.freedesktop.org/show_bug.cgi?id=24531 NOTE: this is a candidate for the 7.10 branch.
* glsl: Add support for the 'u' and 'U' unsigned integer suffixes.Kenneth Graunke2010-11-151-6/+8
|
* glsl: Add new keywords and reserved words for GLSL 1.30.Kenneth Graunke2010-11-151-0/+21
|
* glsl: Rework reserved word/keyword handling in the lexer.Kenneth Graunke2010-11-151-117/+122
| | | | | | | | | | | | | | | | This consolidates the TOKEN_OR_IDENTIFIER and RESERVED_WORD macros into a single KEYWORD macro. The old TOKEN_OR_IDENTIFIER macros handled the case of a word going from an identifier to a keyword; the RESERVED_WORD macro handled a word going from a reserved word to a language keyword. However, neither could properly handle samplerBuffer (for example), which is an identifier in 1.10 and 1.20, a reserved word in 1.30, and a keyword in 1.40 and on. Furthermore, the existing macros didn't properly handle reserved words in GLSL ES 1.00. The best they could do was return a token (rather than an identifier), resulting in an obtuse parser error, rather than a user-friendly "you used a reserved word" error message.
* glsl: Fix lexer rule for ^=Chad Versace2010-10-191-1/+1
| | | | The caret is a special character, and needs to be quoted or escaped.
* glsl: Add lexer rules for << and >> in GLSL 1.30Chad Versace2010-10-151-0/+2
| | | | Commit for generated file glsl_lexer.cpp follows this commit.
* glsl: Add lexer rules for uint and uvecN (N=2..4)Chad Versace2010-10-111-0/+4
| | | | | | Commit for generated file glsl_lexer.cpp follows this commit. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add parser support for GL_ARB_explicit_attrib_location layoutsIan Romanick2010-10-081-0/+1
| | | | | Only layout(location=#) is supported. Setting the index requires GLSL 1.30 and GL_ARB_blend_func_extended.
* glsl: Recognize GLSL ES 1.00 keywords.Kenneth Graunke2010-09-071-7/+17
|
* glsl2: Parse #pragma linesIan Romanick2010-08-301-2/+22
| | | | | | | | All pragmas are currently ignored. Also, the error messages when a pragma is used incorrectly (i.e., '#pragma debug(on)' inside a function) are crap, but I think this is sufficient for now. Fixes piglit test cases pragma-0[1-8].(vert|frag).
* glsl2: Avoid token name collisions with names used by Windows header filesIan Romanick2010-08-131-13/+13
|
* glsl2: Eliminate tokens for square matrix short namesIan Romanick2010-08-131-3/+3
| | | | | | MAT2 and MAT2X2, for example, are treated identically by the parser. The language version based error checking (becuase mat2x2 is not available in GLSL 1.10) is already done in the lexer.
* glsl2: Emit error from lexer when illegal reserved word is encounteredIan Romanick2010-08-111-41/+51
| | | | | | | | Without this, the parser will generate obtuse, useless error diagnostics when reservered word that are not used by the grammar are encountered in a shader. Fixes bugzilla #29519.
* glsl2: Add the 1.30 reserved keywords.Kenneth Graunke2010-08-071-0/+32
|
* glsl2: Add support for floating constants like "1f".Eric Anholt2010-08-021-0/+4
| | | | Fixes glsl-floating-constant-120.
* glsl2: Make non-square matrix keywords not keywords pre-120.Eric Anholt2010-08-011-81/+28
| | | | Fixes glsl-mat-110.
* glsl2: Make lowp, mediump, highp, and precision identifiers pre-1.20.Eric Anholt2010-07-281-4/+32
| | | | Fixes glsl-precision-110.
* glsl2: Parser support for GL_ARB_fragment_coord_conventionsIan Romanick2010-07-281-0/+10
|
* glsl2: Fix lexing of octal values, including "0".Eric Anholt2010-07-191-1/+1
| | | | | | | | When faced with a constructor like 'ivec4(0, 2, 0, 0)', we would manage to get a value of 2 instead of 0 for the first "0". Usually 2 characters past "0" would point at some junk and lex as 0 anyway. Fixes glsl-octal and glsl-unused-varyings.
* glsl2: Initialize yylineno and yycolumn so line numbers are sane.Kenneth Graunke2010-07-071-0/+2
|
* glsl2: Append _TOK to some parser tokensIan Romanick2010-07-011-3/+3
| | | | | This prevents conflicts with defines elsewhere in Mesa and allows including mtypes.h in the compiler.
* glsl2: Use _mesa_glsl_parse_state as the talloc parent, not glsl_shader.Kenneth Graunke2010-06-301-1/+1
| | | | | | | | | | | | | _mesa_glsl_parse_state should be the parent for all temporary allocation done while compiling a shader. glsl_shader should only be used as the parent for the shader's final IR---the _result_ of compilation. Since many IR instructions may be added or discarded during optimization passes, IR should not ever be allocated to glsl_shader directly. Done via sed -i s/talloc_parent(state)/state/g and s/talloc_parent(st)/st/g. This also removes a ton of talloc_parent calls, which may help performance.
* glsl2: Move the compiler to the subdirectory it will live in in Mesa.Eric Anholt2010-06-241-0/+336