summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_lexer.ll
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Allow layout qualifiers in GLSL 3.00 ESIan Romanick2012-12-061-1/+1
| | | | | | | | | | Note that while 'packed' is a reserved word in GLSL ES, row_major is not. This means that we have to use the string-based matching for that. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Enable GLSL ES 3.00 features inherited from desktop GLSL.Paul Berry2012-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | This patch turns on the following features for GLSL ES 3.00: - Array constructors, whole array assignment, and array comparisons. - Second and third operands of ?: may be arrays. - Use of "in" and "out" qualifiers on globals. - Bitwise and modulus operators. - Integral vertex shader inputs. - Range-checking of literal integers. - array.length method. - Function calls may be constant expressions. - Integral varyings must be qualified with "flat". - Interpolation and centroid qualifiers may not be applied to vertex shader inputs. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: parse GLSL ES 3.00 keywords correctly.Paul Berry2012-12-061-78/+111
| | | | | | | | | | | | | | | | | | | | | GLSL ES 3.00 adds the following keywords over GLSL 1.00: uint, uvec[2-4], matNxM, centroid, flat, smooth, various samplers, layout, switch, default, and case. Additionally, it reserves a large number of keywords, some of which were already reserved in versions of desktop GL that Mesa supports, some of which are new to Mesa. A few of the reserved keywords in GLSL ES 3.00 are keywords that are supported in all other versions of GLSL: attribute, varying, sampler1D, sampler1DShador, sampler2DRect, and sampler2DRectShadow. This patch updates the lexer to handle all of the new keywords correctly when the language being parsed is GLSL 3.00 ES. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Rework lexer keyword handling in preparation for GLSL 3.00 ES.Paul Berry2012-12-061-132/+136
| | | | | | | | | | | | | | | | | | | | | | | | This patch expands the lexer KEYWORD macro to take two additional arguments: the GLSL ES versions in which the given keyword was first reserved, and supported, respectively. This will allow us to trivially add support for GLSL 3.00 ES keywords, even though the set of GLSL 3.00 ES keywords is neither a subset or a superset of the keywords corresponding to any desktop GLSL version. The new KEYWORD macro makes use of the _mesa_glsl_parse_state::is_version() function, so it accepts 0 as meaning "unsupported" (rather than 999, which we used previously). Note that a few keywords ("packed" and "row_major") are supported *either* when GLSL 1.40 is in use or when ARB_uniform_buffer_obj support is enabled. Previously, we handled these by cleverly taking advantage of the fact that the KEYWORD macro didn't parenthesize its arguments in the usual way. Now they are handled more straightforwardly, with a new macro, KEYWORD_WITH_ALT. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: Make use of new _mesa_glsl_parse_state::is_version() function.Paul Berry2012-12-061-2/+2
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl: add ARB_texture_cube_map_array support (v2)Dave Airlie2012-11-091-2/+27
| | | | | | | | | | | | This adds all the new builtins + the new sampler types, and hooks them up if the extension is supported. v2: fix missing signatures for grad/lod fix missing textureSize clarifications fix compare vs starts with usage Reviewed-by: Kenneth Graunke <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* glsl: Add parsing for GLSL uniform blocks.Eric Anholt2012-07-091-2/+3
| | | | | | | | 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: Mark [iu]sampler{Buffer,2DRect}as reserved in GLSL 1.40.Eric Anholt2012-04-161-0/+6
| | | | | | | | | 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: rename VERSION to VERSION_TOK for automakeMatt Turner2012-01-041-1/+1
| | | | Signed-off-by: Matt Turner <[email protected]>
* glsl: finish up ARB_conservative_depth (v2)Marek Olšák2011-11-221-0/+1
| | | | | | | v2: updated an error message Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: add support for GL_OES_EGL_image_externalChia-I Wu2011-11-031-0/+7
| | | | | | | | | | 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: Fix compilation of glsl_lexer.ll with MSVC.Morgan Armand2011-10-291-0/+4
| | | | strtoull is not supported on msvc (as there is no C99 support).
* glsl: Implement GLSL 1.30's literal integer range restrictions.Eric Anholt2011-10-281-8/+45
| | | | | | | | | | | | | | | | From page 22 (28 of PDF) of GLSL 1.30 spec: It is an error to provide a literal integer whose magnitude is too large to store in a variable of matching signed or unsigned type. Unsigned integers have exactly 32 bits of precision. Signed integers use 32 bits, including a sign bit, in two's complement form. Fixes piglit int-literal-too-large-0[123].frag. v2: Take care with INT_MIN, use stroull, and make it a function. Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Define YY_NO_UNISTD_H on MSVC.José Fonseca2011-03-041-0/+4
|
* glsl: Rename .lpp to .ll and .ypp to .yy.Kenneth Graunke2011-03-011-0/+453
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.