summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser.yy
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Add parsing for GLSL uniform blocks.Eric Anholt2012-07-091-0/+122
| | | | | | | | This doesn't do anything with the uniform block declarations yet, so usage of those uniforms finds them to be undeclared. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Don't hide the type of struct_declaration_list.Eric Anholt2012-07-091-3/+3
| | | | | | | | I've been trying to derive from this for UBO support, and the slightly obfuscated types were putting me over the edge. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Reduce a bit of extra code in the merging of layout qualifiers.Eric Anholt2012-07-091-7/+2
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Take advantage of the layout qualifier flags union to clean up parsing.Eric Anholt2012-07-091-21/+7
| | | | | | | | | The got_one variable was set iff one of the bits in flags.i was set. v2: Fix incorrect dropping of the ARB_conservative_depth warning. Reviewed-by: Kenneth Graunke <[email protected]> (v1) Reviewed-by: Ian Romanick <[email protected]>
* glsl: Mark [iu]sampler{Buffer,2DRect}as reserved in GLSL 1.40.Eric Anholt2012-04-161-2/+8
| | | | | | | | | The non-integer versions were already reserved in 1.30, but apparently these were forgotten. Fixes piglit glsl-1.40/compiler/reserved/ Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: add support for ARB_blend_func_extended (v3)Dave Airlie2012-04-131-0/+20
| | | | | | | | | | | | | | | | | | | This adds index support to the GLSL compiler. I'm not 100% sure of my approach here, esp without how output ordering happens wrt location, index pairs, in the "mark" function. Since current hw doesn't ever have a location > 0 with an index > 0, we don't have to work out if the output ordering the hw requires is location, index, location, index or location, location, index, index. But we have no hw to know, so punt on it for now. v2: index requires layout - catch and error setup explicit index properly. v3: drop idx_offset stuff, assume index follow location Signed-off-by: Dave Airlie <[email protected]>
* glsl: Add support for parsing [iu]samplerBuffer types in GLSL 1.40.Eric Anholt2012-04-091-0/+1
| | | | | | | | | The samplerBuffer type will be undefined in !glsl 1.40, and the keyword is marked as reserved. The [iu]samplerBuffer types are not marked as reserved pre-1.40, so they don't have separate tokens and fall through to normal type handling. Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Drop the round-trip through ast_type_specifier for many builtin types.Eric Anholt2012-04-091-53/+53
| | | | | | | | | | We have lexer recognition of a bunch of our types based on the handling. This code was mapping those recognized tokens to an enum and then to a string of their name. Just drop the enums and provide the string directly in the parser. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Use (const char *) in AST nodes rather than plain (char *).Kenneth Graunke2012-04-091-1/+1
| | | | | | | | | | | Nothing actually relied on them being mutable, and there was at least one cast which discarded const qualifiers. The next patch would have introduced many more. Casting away const qualifiers should be avoided if at all possible. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add support for parsing #version 140.Eric Anholt2012-03-151-0/+3
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add other missing error location information for switch statements.Eric Anholt2012-02-031-0/+4
| | | | | | NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add missing location info to case labels.Eric Anholt2012-02-031-0/+2
| | | | | | | | Otherwise, the upcoming error messages said the location was 0:0(0). NOTE: This is a candidate for the 8.0 branch. Reviewed-by: Ian Romanick <[email protected]>
* 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.