summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser.ypp
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Reject shader versions not supported by the implementationIan Romanick2011-01-311-9/+24
| | | | | | | | Previously we'd happily compile GLSL 1.30 shaders on any driver. We'd also happily compile GLSL 1.10 and 1.20 shaders in an ES2 context. This has been a long standing FINISHME in the compiler. NOTE: This is a candidate for the 7.9 and 7.10 branches
* Convert everything from the talloc API to the ralloc API.Kenneth Graunke2011-01-311-1/+1
|
* glsl: Add support for AMD_conservative_depth to parserChad Versace2011-01-261-8/+31
| | | | | | | | | | When AMD_conservative_depth is enabled: * Let 'layout' be a token. * Extend the production rule of layout_qualifier_id to process the tokens: depth_any depth_greater depth_less depth_unchanged
* glsl: Remove redundant semantic check in parserChad Versace2011-01-171-6/+0
| | | | | | | | The removed semantic check also exists in ast_type_specifier::hir(), which is a more natural location for it. The check verified that precision statements are applied only to types float and int.
* glsl: Add support for default precision statementsChad Versace2011-01-171-6/+7
| | | | | | * Add new field ast_type_specifier::is_precision_statement. * Add semantic checks in ast_type_specifier::hir(). * Alter parser rules accordingly.
* glsl: Fix parser rule for type_specifierChad Versace2011-01-171-0/+3
| | | | | Do not assign a value to ast_type_specifier::precision when no precision qualifier is present.
* glsl: Add version_string containing properly formatted GLSL versionIan Romanick2011-01-101-14/+13
|
* glsl: Support the 'invariant(all)' pragmaIan Romanick2011-01-061-0/+14
| | | | | | | | | | | | | 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: Add new keywords and reserved words for GLSL 1.30.Kenneth Graunke2010-11-151-0/+1
|
* glsl: Fix copy and paste error in ast_bit_and node creation.Kenneth Graunke2010-10-181-1/+1
| | | | All & operations were incorrectly being generated as ast_bit_or.
* glsl: Add parser support for GL_ARB_explicit_attrib_location layoutsIan Romanick2010-10-081-4/+51
| | | | | Only layout(location=#) is supported. Setting the index requires GLSL 1.30 and GL_ARB_blend_func_extended.
* glsl: Wrap ast_type_qualifier contents in a struct in a unionIan Romanick2010-10-081-36/+41
| | | | This will ease adding non-bit fields in the near future.
* glsl: Clear type_qualifier using memsetIan Romanick2010-10-081-19/+86
|
* glsl: Slight refactor of error / warning checking for ARB_fcc layoutIan Romanick2010-10-081-9/+7
|
* glsl: Refactor 'layout' grammar to match GLSL 1.60 spec grammarIan Romanick2010-10-081-10/+21
|
* glsl: Recognize GLSL ES 1.00 keywords.Kenneth Graunke2010-09-071-33/+33
|
* glsl: Accept language version 100 and make it the default on ES2.Kenneth Graunke2010-09-071-0/+2
|
* glsl: Set default language version in mesa_glsl_parse_state constructor.Kenneth Graunke2010-09-071-6/+1
| | | | | | | | | | This should make it easier to change the default version based on the API (say, version 1.00 for OpenGL ES). Also, synchronize the symbol table's version with the parse state's version just before doing AST-to-HIR. This way, it will be set when it matters, but the main initialization code doesn't have to care about the symbol table.
* glsl: Change grammar rules for selection statements to match the spec.Kenneth Graunke2010-09-071-33/+19
| | | | | | Fixes piglit test case loop-06.vert. Unfortunately, causes 1 shift/reduce conflict.
* glsl2: Parse #pragma linesIan Romanick2010-08-301-1/+11
| | | | | | | | 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).
* glsl: Use a single shared namespace in the symbol table.Kenneth Graunke2010-08-261-0/+2
| | | | | | | | | | | | As of 1.20, variable names, function names, and structure type names all share a single namespace, and should conflict with one another in the same scope, or hide each other in nested scopes. However, in 1.10, variables and functions can share the same name in the same scope. Structure types, however, conflict with/hide both. Fixes piglit tests redeclaration-06.vert, redeclaration-11.vert, redeclaration-19.vert, and struct-05.vert.
* glsl2: Remove unnecessary use of 'struct' before type namesIan Romanick2010-08-131-18/+18
| | | | | | | | In C++ you don't have to say 'struct' or 'class' if the declaration of the type has been seen. Some compilers will complain if you use 'struct' when 'class' should have been used and vice versa. Fixes bugzilla #29539.
* glsl2: Avoid token name collisions with names used by Windows header filesIan Romanick2010-08-131-18/+18
|
* glsl2: Eliminate tokens for square matrix short namesIan Romanick2010-08-131-4/+1
| | | | | | 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: Use bison command line option to set prefixIan Romanick2010-08-111-1/+0
| | | | | | Bison version 2.3 doesn't seem to support %name-prefix in the source. This should fix bugzilla #29207.
* glsl2: Emit error from lexer when illegal reserved word is encounteredIan Romanick2010-08-111-0/+2
| | | | | | | | 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: Initialize location structure at beginning of parse.Carl Worth2010-08-101-1/+9
| | | | | | | | Since we have a custom structure for YYLTYPE locations, we need to use an %initial-action directive to avoid triggering use of uninitialized memory when, for example, printing error messages. Thanks to valgrind for noticing this bug.
* glsl2: Add the 1.30 reserved keywords.Kenneth Graunke2010-08-071-1/+8
|
* glsl2: Fix spelling of "precision" in error output.Eric Anholt2010-08-021-3/+3
|
* glsl2: Parser support for GL_ARB_fragment_coord_conventionsIan Romanick2010-07-281-2/+59
|
* glsl2: Remove incorrect assertion in the parser.Kenneth Graunke2010-07-201-6/+0
| | | | | | | | | | | This assertion is triggered by method calls (i.e. array.length()), where subexpressions[1] is an ast_function_call expression. Since the assertion itself had a comment saying it could be removed eventually, simply do so. Causes negative glslparser tests array-length-110.frag, array-length-args.frag, and array-length-unsized.frag to pass, but only because the length() method is not supported yet.
* glsl2: Append _TOK to some parser tokensIan Romanick2010-07-011-4/+4
| | | | | 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-87/+87
| | | | | | | | | | | | | _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/+1444