[Mesa-dev] [PATCH] glsl: Relax GLSL 1.10 float suffix error to a warning.

Lars Hamre chemecse at gmail.com
Wed Apr 20 19:48:17 UTC 2016


I am fine with this, it would be nice if we could modify the following
piglit tests to pass when a warning is emitted:
https://cgit.freedesktop.org/piglit/tree/tests/spec/glsl-1.10/compiler/literals/invalid-float-suffix-capital-f.vert
https://cgit.freedesktop.org/piglit/tree/tests/spec/glsl-1.10/compiler/literals/invalid-float-suffix-f.vert

Either way,
Reviewed-by: Lars Hamre <chemecse at gmail.com>

On Wed, Apr 20, 2016 at 3:29 PM, Matt Turner <mattst88 at gmail.com> wrote:
>
> Float suffixes are allowed in all subsequent GLSL specifications, and
> it's obvious what the user meant if they specify one. Accept it with a
> warning to avoid breaking applications, like Planeshift.
> ---
>  src/compiler/glsl/glsl_lexer.ll | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/compiler/glsl/glsl_lexer.ll b/src/compiler/glsl/glsl_lexer.ll
> index 6b1ef17..8a562cb 100644
> --- a/src/compiler/glsl/glsl_lexer.ll
> +++ b/src/compiler/glsl/glsl_lexer.ll
> @@ -476,8 +476,8 @@ layout              {
>                             char suffix = yytext[strlen(yytext) - 1];
>                             if (!state->is_version(120, 300) &&
>                                 (suffix == 'f' || suffix == 'F')) {
> -                               _mesa_glsl_error(yylloc, state,
> -                                                "Float suffixes are invalid in GLSL 1.10");
> +                               _mesa_glsl_warning(yylloc, state,
> +                                                  "Float suffixes are invalid in GLSL 1.10");
>                             }
>                             yylval->real = _mesa_strtof(yytext, NULL);
>                             return FLOATCONSTANT;
> --
> 2.7.3
>


More information about the mesa-dev mailing list