glsl parser: on desktop GL require GLSL 150 for instance names
authorJordan Justen <jordan.l.justen@intel.com>
Sat, 9 Mar 2013 22:09:30 +0000 (14:09 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Thu, 23 May 2013 16:37:11 +0000 (09:37 -0700)
Interface blocks in GLSL 150 allow an instance name to be used.

v2:
 * use state->check_version

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/glsl_parser.yy

index dbc25a4840538bed8b25d1e3fe741ca7a8ac4e25..70764d6dbf31d98e10c233425bab1d2cc74dbd54 100644 (file)
@@ -1953,11 +1953,9 @@ basic_interface_block:
            * the same language versions, we don't have to explicitly
            * version-check both things.
            */
-          if (block->instance_name != NULL
-              && !(state->language_version == 300 && state->es_shader)) {
-             _mesa_glsl_error(& @1, state,
-                              "#version 300 es required for using uniform "
-                              "blocks with an instance name\n");
+          if (block->instance_name != NULL) {
+             state->check_version(150, 300, & @1, "interface blocks with "
+                       "an instance name are not allowed");
           }
 
           block->layout.flags.i |= $1.flags.i;