glsl: Relax GLSL 1.10 float suffix error to a warning.
authorMatt Turner <mattst88@gmail.com>
Wed, 20 Apr 2016 19:29:23 +0000 (12:29 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 21 Apr 2016 17:33:08 +0000 (10:33 -0700)
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 (although it
looks like between 0.6.1 and 0.6.3 they might have removed the suffixes
from their shaders).

Reviewed-by: Lars Hamre <chemecse@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/glsl_lexer.ll

index 6b1ef1717e5e365a7bbce1f60eb3e16a1810a129..8a562cbcb00cdddb670cce313c53592b60163bed 100644 (file)
@@ -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;