glsl: Fix up GL_ARB_compute_shader for GLSL ES 3.1
authorMarta Lofstedt <marta.lofstedt@intel.com>
Mon, 10 Aug 2015 11:04:42 +0000 (13:04 +0200)
committerTapani Pälli <tapani.palli@intel.com>
Wed, 19 Aug 2015 10:41:43 +0000 (13:41 +0300)
GL_ARB_compute_shader is limited for GLSL version 430.
This enables for GLSL ES version 310.

V2: Updated error string to also include GLSL 3.10

Signed-off-by: Marta Lofstedt <marta.lofstedt@linux.intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/glsl/glsl_parser.yy
src/glsl/glsl_parser_extras.h

index 2b0c8bd8c6f111eb55707023679ab81337d5d45e..7a4b55c6f2b04fd76d32ca77071f755f72302771 100644 (file)
@@ -1519,11 +1519,10 @@ layout_qualifier_id:
                                 "invalid %s of %d specified",
                                 local_size_qualifiers[i], $3);
                YYERROR;
-            } else if (!state->is_version(430, 0) &&
-                       !state->ARB_compute_shader_enable) {
+            } else if (!state->has_compute_shader()) {
                _mesa_glsl_error(& @3, state,
                                 "%s qualifier requires GLSL 4.30 or "
-                                "ARB_compute_shader",
+                                "GLSL ES 3.10 or ARB_compute_shader",
                                 local_size_qualifiers[i]);
                YYERROR;
             } else {
index eb325f04eed90065396a63df0905c43ad3ee33cd..57a7555158a7fd86b7c6c994f14b51ba62fb5665 100644 (file)
@@ -236,6 +236,11 @@ struct _mesa_glsl_parse_state {
       return ARB_shading_language_420pack_enable || is_version(420, 0);
    }
 
+   bool has_compute_shader() const
+   {
+      return ARB_compute_shader_enable || is_version(430, 310);
+   }
+
    void process_version_directive(YYLTYPE *locp, int version,
                                   const char *ident);