summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_parser.yy
Commit message (Collapse)AuthorAgeFilesLines
* glsl: Create and use a has_uniform_buffer_objects() helper.Kenneth Graunke2013-09-261-3/+3
| | | | | | | | | | | This is better than overriding the extension enable based on the language version; it's robust against shaders that do: #version 140 #extension GL_ARB_uniform_buffer_object : disable Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Create and use a has_explicit_attrib_location() helper.Kenneth Graunke2013-09-261-1/+1
| | | | | | | | | | | | | | | | | | | Explicit attribute locations are supported with GLSL 3.30, GLSL ES 3.00, or "#extension GL_ARB_explicit_attrib_location: enable". Using a helper function makes it easy to check for this. This enables support in GLSL 3.30, which was previously missing. Previously, we overrode the extension enable flag for ES 3.00. This is not robust against a shader such as: #version 330 #extension GL_ARB_explicit_attrib_location : disable Disabling extensions should not remove core language functionality. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Reallow precision qualifiers on structure membersIan Romanick2013-09-041-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes to the grammar for GL_ARB_shading_language_420pack (commit 6eec502) moved precision qualifiers out of the type_specifier production chain. This caused declarations such as: struct S { lowp float f; }; to generate parse errors. Section 4.1.8 (Structures) of both the GLSL ES 1.00 spec and GLSL 1.30 specs says: "Member declarators may contain precision qualifiers, but may not contain any other qualifiers." So, it sure seems like we shouldn't generate a parse error. :) Instead of type_specifier, use fully_specified_type in struct members. However, fully_specified_type allows a lot of other qualifiers that are not allowed on structure members, so expeclitly disallow them. Note, this makes struct_declaration look an awful lot like member_declaration (used for interface blocks). We may want to (somehow) unify these rules to reduce code duplication at some point. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68753 Reported-by: Aras Pranckevicius <[email protected]> Cc: Aras Pranckevicius <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Cc: "9.2" <[email protected]>
* glsl: Remove ubo_qualifiers_allowed variable.Matt Turner2013-08-211-1/+0
| | | | | | | No longer used. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* glsl: Rename ubo_qualifiers_valid to ubo_qualifiers_allowed.Matt Turner2013-08-211-1/+1
| | | | | | | | | The variable means that UBO qualifiers are allowed in a particular context (e.g., not allowed in a struct field declaration), rather than a particular set of UBO qualifiers are valid. Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* glsl: Enable ARB_fragment_coord_conventions functionality in GLSL 1.50.Paul Berry2013-08-091-1/+2
| | | | | | | | | GLSL 1.50 incorporates the functionality of the ARB_fragment_coord_conventions extension, so we need to make this functionality available even if the extension isn't enabled. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Allow geometry shader input instance arrays to be unsized.Paul Berry2013-08-011-7/+4
| | | | | Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Parse the GLSL 1.50 GS layout qualifiers.Eric Anholt2013-08-011-1/+75
| | | | | | | | | | | | | | | Limited semantic checking (compatibility between declarations, checking that they're in the right shader target, etc.) is done. v2: Remove stray debug printfs. v3 (Paul Berry <[email protected]>): Process input layout qualifiers at ast_to_hir time rather than at parse time, since certain error conditions depend on the relative ordering between input layout qualifiers, declarations, and calls to .length(). Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Switch from the deprecated YYLEX_PARAM to %lex-param.Kenneth Graunke2013-07-311-5/+3
| | | | | | | | | | | | | | | | | | | | | YYLEX_PARAM is no longer supported as of Bison 3.0. Instead, the Bison developers recommend using %lex-param. %lex-param takes a type and variable name, similar to %parse-param, so you can't pass an arbitrary expression like state->scanner. But Flex insists on passing the actual scanner object, not an arbitrary object like state. To solve this, the parser defines a wrapper lex() function which accepts "state," and calls Flex's lex() function with state->scanner. Fixes the build with Bison 3.0. Also works with Bison 2.7.1. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Tested-by: Laurent Carlier <[email protected]> Cc: "9.2" [email protected]
* glsl: Change the lexer's namespace.Kenneth Graunke2013-07-311-0/+6
| | | | | | | | | | | | Bison 3.0 removes the YYLEX_PARAM macro. In preparation for handling this using %lex-param, the parser needs a wrapper function for the actual Flex lex() function. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354 Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Tested-by: Laurent Carlier <[email protected]> Cc: "9.2" [email protected]
* glsl: Be consistent about '\n', '.', and capitalization in errors/warnings.Paul Berry2013-07-271-46/+46
| | | | | | | | | | | | The majority of calls to _mesa_glsl_error(), _mesa_glsl_warning(), and _mesa_glsl_parse_state::check_version() use a message that begins with a lower case letter and ends without a period. This patch makes all messages follow that convention. Also, error/warning messages shouldn't end in '\n', since _mesa_glsl_msg() automatically adds '\n' at the end of the message. Reviewed-by: Matt Turner <[email protected]>
* glsl: Parse the "binding" keyword and store it in ast_type_qualifier.Kenneth Graunke2013-07-181-0/+6
| | | | | | | | | Nothing actually uses this yet. v2: Remove >= 0 checks. They'll be handled in later validation. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Paul Berry <[email protected]>
* glsl: Relax auxiliary storage ordering requirements with 420pack.Kenneth Graunke2013-07-181-1/+2
| | | | | | | | These were already semi-relaxed, since the storage qualifier rule already skipped when 420pack was enabled. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Handle centroid qualifier ordering in C code, not the parser.Kenneth Graunke2013-07-181-20/+30
| | | | | | | | | | | | | The GL_ARB_shading_language_420pack extension/GLSL 4.20 split centroid off into a new category, "auxiliary storage qualifiers," and allow these to be placed anywhere in the series. So we have to stop recognizing "centroid in"/"centroid out"/"centroid varying" in the grammar and get more creative. The same approach used before works here, too. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Allow precision qualifiers to be flexibly ordered with 420pack.Kenneth Graunke2013-07-181-2/+2
| | | | | Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Move precision handling to be part of qualifier handling.Kenneth Graunke2013-07-181-15/+28
| | | | | | | | | This is necessary for the parser to be able to accept precision qualifiers not immediately adjacent to the type, such as "const highp inout float foo". Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Change is_precision_statement to default_precision != none.Kenneth Graunke2013-07-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | Currently, we store precision in ast_type_specifier, rather than ast_type_qualifier. This works because precision is the last qualifier, and immediately adjacent to the type. Default precision statements (such as "precision highp float") are represented as ast_type_specifier objects, with a boolean to indicate that it's a default precision statement rather than an ordinary type. ast_type_specifier::precision will be moving to ast_type_qualifier soon, in order to support arbitrary qualifier ordering. However, we still need to store a "this is a precision statement" flag /and/ the default precision in ast_type_specifier. This patch changes the boolean into a new field, default_precision. If default_precision != ast_precision_none, it's a precision statement with the specified precision. Otherwise, it's an ordinary type. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Disable ordering checks for const parameters with 420pack.Kenneth Graunke2013-07-181-1/+1
| | | | | | | This makes the complier accept both "const in" and "in const". Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Handle "const" as a parameter qualifier.Kenneth Graunke2013-07-181-29/+14
| | | | | | | | This will make it easy to support both "const in" and "in const", as required by GLSL 4.20/ARB_shading_language_420pack. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Refactor parameter qualifier handling.Kenneth Graunke2013-07-181-1/+12
| | | | | | | | | | | "Parameter direction qualifier" is a new term I invented just now; it's not part of any GLSL specification. This paves the way handling multiple parameter qualifiers, in any order, as required by GLSL 4.20/ARB_shading_language_420pack. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Use merge_qualifier() when processing qualifier lists.Kenneth Graunke2013-07-181-3/+3
| | | | | | | | | | | | | | | | | | | Most of ast_type_qualifier is simply a bitfield (represented as a structure of unsigned:1 bits in a union with an unsigned). However, it also contains ARB_explicit_attrib_location's location/index fields. In the past, this has worked by simply returning the layout qualifier's ast_type_qualifier and merging the other bits into it. However, that's not obvious until you break it by switching $1 and $2. Using merge_qualifier() copies them appropriately, and also properly overrides layout qualifiers. It also checks for duplicate qualifiers, which renders some of the checks in the previous patch unnecessary. However, those checks provide better error messages, such as "Duplicate interpolation qualifier", rather than just "duplicate qualifier". Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Allow duplicate layout qualifiers with 420pack.Kenneth Graunke2013-07-181-1/+1
| | | | | | | The new 4.20 rules explicitly allow multiple layout(...) sections. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Disable ordering checks on most qualifiers for 420pack.Kenneth Graunke2013-07-181-2/+3
| | | | | | | | | This makes the compiler accept invariant, storage, layout, and interpolation qualifiers in any order when ARB_shading_language_420pack is enabled. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Handle most qualifier ordering in C code rather than the grammar.Kenneth Graunke2013-07-181-18/+92
| | | | | | | | | | | | | | | | | The GL_ARB_shading_language_420pack extension/GLSL 4.20 allow qualifiers to be specified in (basically) any order. In order to support this, we can't hardcode the ordering restrictions in the grammar. This patch alters the grammar to accept invariant, storage, layout, and interpolation qualifiers in any order, but adds C code to enforce the ordering requirements. In the 420pack case, we should be able to simply skip the error checks. As a bonus, this also lets us generate decent error messages, rather than Bison's awful "unexpected TOKEN" errors. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* glsl: Fix absurd whitespace conventions in the parser.Kenneth Graunke2013-07-161-1696/+1691
| | | | | | | | | | | | | | | | | | | Historically, we indented grammar production rules with a single 8-space tab, but code inside of blocks used Mesa's 3-space indents. This meant when editing code, you had to use an 8-space tab for the first level of indentation, and 3-spaces after that. Unless you specifically configure your editor to understand this, it will get the indentation wrong on every single line you touch, which quickly devolves into a colossal waste of time. It's also inconsistent with every other file in the entire project. This patch removes all tabs and moves to a consistent 3-space indent. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* glsl: Fail the build if the grammar contains shift/reduce errors.Kenneth Graunke2013-07-161-0/+2
| | | | | | | | | When working on a parser, it's very easy to accidentally introduce new shift/reduce conflicts. Failing the build guarantees they'll be noticed and fixed. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* glsl: Silence the last shift/reduce conflict warning in the grammar.Kenneth Graunke2013-07-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | The single remaining shift/reduce conflict was the classic ELSE problem: 292 selection_rest_statement: statement . ELSE statement 293 | statement . ELSE shift, and go to state 479 ELSE [reduce using rule 293 (selection_rest_statement)] $default reduce using rule 293 (selection_rest_statement) The correct behavior here is to shift, which is what happens by default. However, resolving it explicitly will make it possible to fail the build on new errors, making them much easier to detect. The classic way to solve this is to use right associativity: http://www.gnu.org/software/bison/manual/html_node/Non-Operators.html Since there is no THEN token in GLSL, we need to fake one. %right THEN creates a new terminal symbol; the %prec directive says to use the precedence of that terminal. Signed-off-by: Kenneth Graunke <[email protected]> Reviewed-by: Chris Forbes <[email protected]>
* glsl: Add support for C-style initializers.Matt Turner2013-07-111-0/+51
| | | | | | | | | Required by GL_ARB_shading_language_420pack. Parts based on work done by Todd Previte and Ken Graunke, implementing basic support for C-style initializers of arrays. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Add comment explaining "row_major" parsing.Matt Turner2013-07-111-0/+6
| | | | Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Remove outdated FINISHME comment.Matt Turner2013-07-111-3/+0
| | | | | | Explicit index support was added by commit 1256a5dc. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Bail on parsing if the #version directive is bogus.Kenneth Graunke2013-06-101-0/+6
| | | | | | | | | | | | | | | | | | | If we didn't successfully parse the #version line, there's no point in continuing with parsing and compiling: it's already failed. Furthermore, it can actually be harmful: right after handling #version, we call _mesa_glsl_initialize_types(), which checks state->es_shader and language_version. If it isn't valid, it hits an assertion failure. Fixes Piglit's "invalid-version-es." When processing "#version 110 es", our code set state->es_shader and state->language_version = 110. It then properly determined that this was invalid and flagged an error. Since we continued anyway, we hit the assertion mentioned above. NOTE: This is a candidate for the 9.1 branch. Reviewed-by: Matt Turner <[email protected]> Signed-off-by: Kenneth Graunke <[email protected]>
* glsl parser: allow in & out for interface block membersJordan Justen2013-05-231-25/+12
| | | | | | | | | | | | | Previously uniform blocks allowed for the 'uniform' keyword to be used with members of a uniform blocks. With interface blocks 'in' can be used on 'in' interface block members and 'out' can be used on 'out' interface block members. The basic_interface_block rule will verify that the same qualifier type is used with the block and each member. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl parser: handle interface block member qualifierJordan Justen2013-05-231-1/+43
| | | | | | | | | | | | | | | | | | | | | An interface block member may specify the type: in { in vec4 in_var_with_qualifier; }; When specified with the member, it must match the same type as interface block type. It can also omit the qualifier: uniform { vec4 uniform_var_without_qualifier; }; When the type is not specified with the member, it will adopt the same type as the interface block. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl parser: on desktop GL require GLSL 150 for instance namesJordan Justen2013-05-231-5/+3
| | | | | | | | | | | Interface blocks in GLSL 150 allow an instance name to be used. v2: * use state->check_version Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl parser: reject VS+in & FS+out interface blocksJordan Justen2013-05-231-0/+14
| | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: parse in/out types for interface blocksJordan Justen2013-05-231-11/+40
| | | | | | | | | | | Previously only 'uniform' was allowed for uniform blocks. Now, in/out can be parsed, but it will only be allowed for GLSL >= 150. Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl parser: rename uniform block to interface blockJordan Justen2013-05-231-12/+12
| | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: rename ast_uniform_block to ast_interface_blockJordan Justen2013-05-231-7/+7
| | | | | | Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: add support for ARB_texture_multisampleChris Forbes2013-03-021-2/+9
| | | | | | | | | | | | | | | | | | V2: - emit `sample` parameter properly for multisample texelFetch() - fix spurious whitespace change - introduce a new opcode ir_txf_ms rather than overloading the existing ir_txf further. This makes doing the right thing in the driver somewhat simpler. V3: - fix weird whitespace V4: - don't forget to include the new opcode in tex_opcode_strs[] (thanks Kenneth for spotting this) Signed-off-by: Chris Forbes <[email protected]> [V2] Reviewed-by: Eric Anholt <[email protected]> [V2] Reviewed-by: Paul Berry <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* glsl: Parse interface array sizeIan Romanick2013-01-251-12/+43
| | | | | | | | | | | | | The size is parsed and stored in the AST, but it is not used yet. Processing of the array size is added in the patch "glsl: Handle instance array declarations" v2: Update the commit message (suggested by Carl Worth). Add a comment to ast_uniform_block::array_size (suggested by Paul Berry). Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Parse non-array uniform block instance names in GLSL ES 3.00.Kenneth Graunke2013-01-251-2/+18
| | | | | | | | | | | | | | | | | | | | | | | In GLSL ES 3.00 (and GLSL 1.50), uniform blocks can have an associated "instance name", which essentially namespaces the variables inside. This patch adds basic parsing for this new feature, but doesn't yet hook it up to actually do anything yet. It does not support for arrays of interface blocks; a later commit will take care of that. This change temporarily regresses the piglit test interface-name-access-without-interface-name.vert. This shader failed to compile before (the expected result), but it failed to compile for the wrong reason. This is not a real regression. v2: Add some comments to ast_uniform_block::instance_name. Suggested by Paul Berry. Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Refactor uniform block parser rules.Kenneth Graunke2013-01-251-21/+16
| | | | | | | | | | | | | The existing code has a lot of duplication; the only difference between the two cases is whether we merge in an additional layout qualifier. Apparently creating a layout_qualifieropt rule that can be empty causes a lot of conflicts and confusion. However, refactoring out the guts of the ast_uniform_block creation works fine. Reviewed-by: Carl Worth <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Don't add structure fields to the symbol tableIan Romanick2013-01-081-1/+0
| | | | | | | | | | | | | | | | | I erroneously added this back in January 2011 in commit 88421589. Looking at the commit message, I have no idea why I added it. It only added non-array structure fields to the symbol table, so array structure fields are treated correctly. Fixes piglit tests structure-and-field-have-same-name.vert and structure-and-field-have-same-name-nested.vert. It should also fix WebGL conformance tests shader-with-non-reserved-words. NOTE: This is a candidate for the stable release branches. Signed-off-by: Ian Romanick <[email protected]> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57622 Reviewed-by: Kenneth Graunke <[email protected]>
* glsl: Add missing semicolon in the grammarKenneth Graunke2012-12-061-0/+1
| | | | | | | | | This may not be strictly necessary, but every other rule in the grammar ends with a semicolon. It also appears that this was supposed to be commited with the original patch that changed this rule, but the wrong version of the patch was accidentally pushed. Reviewed-by: Ian Romanick <[email protected]>
* glsl: Allow layout qualifiers in GLSL 3.00 ESIan Romanick2012-12-061-0/+2
| | | | | | | | | | 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/parser: Handle "#version 300 es" directive.Paul Berry2012-12-061-1/+5
| | | | | | | | | | | | | | | Note that GLSL 1.00 is selected using "#version 100", so "#version 100 es" is prohibited. v2: Check for GLES3 before allowing '#version 300 es' v3: Make sure a correct language_version is set in _mesa_glsl_parse_state::process_version_directive. Signed-off-by: Paul Berry <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>
* glsl/parser: Extract version directive processing into a function.Paul Berry2012-12-061-42/+1
| | | | | | | | | | | | | | Version directive handling is going to have to be used within two parser rules, one for desktop-style version directives (e.g. "#version 130") and one for the new ES-style version directive (e.g. "#version 300 es"), so this patch moves it to a function that can be called from both rules. No functional change. 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-0/+3
| | | | | | | | | | | | | | | | | | | | | 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: Make use of new _mesa_glsl_parse_state::check_version() function.Paul Berry2012-12-061-18/+3
| | | | | | | | | | | | | | | | | | Previous to this patch, we were not very consistent about the errors we generate when a shader tried to use a feature that is prohibited in the current GLSL version. Some error messages failed to mention the GLSL version currently in use (or did so inaccurately), and some error messages failed to mention the first GLSL version in which the given feature is allowed. This patch reworks all of the error checks to use the check_version() function, which produces error messages in a standard form (approximately "$FEATURE forbidden in $CURRENT_GLSL_VERSION ($REQUIRED_GLSL_VERSION required)."). 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/+3
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Acked-by: Carl Worth <[email protected]>