Module: Mesa Branch: staging/21.3 Commit: 9f9def990489363811fac6744a5646674a41c351 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f9def990489363811fac6744a5646674a41c351
Author: Tapani Pälli <[email protected]> Date: Thu Dec 16 19:01:34 2021 +0200 glsl: fix invariant qualifer usage and matching rule for GLSL 4.20 I noticed that GLSL version referenced here was wrong, version 4.20 is first spec that does not allow invariant keyword for inputs. v2: fix all comments (Timothy Arceri) Fixes: f9f462936ad ("glsl: Fix invariant matching in GLSL 4.30 and GLSL ES 1.00.") Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14241> (cherry picked from commit ebd1f202ae10f851b23392c022e059467b90475d) --- .pick_status.json | 2 +- src/compiler/glsl/glsl_parser.yy | 4 ++-- src/compiler/glsl/link_varyings.cpp | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index eab204b1dcc..03eb1054a8d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -301,7 +301,7 @@ "description": "glsl: fix invariant qualifer usage and matching rule for GLSL 4.20", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "f9f462936ad903f93829404ce99a2580ea21b725" }, diff --git a/src/compiler/glsl/glsl_parser.yy b/src/compiler/glsl/glsl_parser.yy index 4111c45c97d..29b6dc2f72e 100644 --- a/src/compiler/glsl/glsl_parser.yy +++ b/src/compiler/glsl/glsl_parser.yy @@ -2047,9 +2047,9 @@ type_qualifier: * output from one shader stage will still match an input of a subsequent * stage without the input being declared as invariant." * - * On the desktop side, this text first appears in GLSL 4.30. + * On the desktop side, this text first appears in GLSL 4.20. */ - if (state->is_version(430, 300) && $$.flags.q.in) + if (state->is_version(420, 300) && $$.flags.q.in) _mesa_glsl_error(&@1, state, "invariant qualifiers cannot be used with shader inputs"); } | interpolation_qualifier type_qualifier diff --git a/src/compiler/glsl/link_varyings.cpp b/src/compiler/glsl/link_varyings.cpp index abae4377e83..4244c2d4e0a 100644 --- a/src/compiler/glsl/link_varyings.cpp +++ b/src/compiler/glsl/link_varyings.cpp @@ -319,13 +319,13 @@ cross_validate_types_and_qualifiers(struct gl_context *ctx, return; } - /* The GLSL 4.30 and GLSL ES 3.00 specifications say: + /* The GLSL 4.20 and GLSL ES 3.00 specifications say: * * "As only outputs need be declared with invariant, an output from * one shader stage will still match an input of a subsequent stage * without the input being declared as invariant." * - * while GLSL 4.20 says: + * while GLSL 4.10 says: * * "For variables leaving one shader and coming into another shader, * the invariant keyword has to be used in both shaders, or a link @@ -337,7 +337,7 @@ cross_validate_types_and_qualifiers(struct gl_context *ctx, * and fragment shaders must match." */ if (input->data.explicit_invariant != output->data.explicit_invariant && - prog->data->Version < (prog->IsES ? 300 : 430)) { + prog->data->Version < (prog->IsES ? 300 : 420)) { linker_error(prog, "%s shader output `%s' %s invariant qualifier, " "but %s shader input %s invariant qualifier\n",
