glsl: allow usage of the keyword buffer before GLSL 430 / ESSL 310
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 9 Apr 2016 17:11:42 +0000 (13:11 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 10 Apr 2016 00:41:54 +0000 (20:41 -0400)
The GLSL 4.20 and ESSL 3.00 specs don't list 'buffer' as a reserved
keyword. Make the parser ignore it unless GLSL 4.30 / ESSL 3.10 are
used, or ARB_shader_storage_buffer_objects is enabled.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Cc: mesa-stable@lists.freedesktop.org
src/compiler/glsl/glsl_lexer.ll

index 0b7695f8d3ee38ae2ac2a39d8a96df6b10b27899..6b1ef1717e5e365a7bbce1f60eb3e16a1810a129 100644 (file)
@@ -304,7 +304,7 @@ in          return IN_TOK;
 out            return OUT_TOK;
 inout          return INOUT_TOK;
 uniform                return UNIFORM;
-buffer         return BUFFER;
+buffer         KEYWORD_WITH_ALT(0, 0, 430, 310, yyextra->ARB_shader_storage_buffer_object_enable, BUFFER);
 varying                DEPRECATED_ES_KEYWORD(VARYING);
 centroid       KEYWORD(120, 300, 120, 300, CENTROID);
 invariant      KEYWORD(120, 100, 120, 100, INVARIANT);