glsl/es3.1: Allow 3.10 ES shaders in a GLES 3.1 context
authorIan Romanick <ian.d.romanick@intel.com>
Tue, 28 Apr 2015 19:13:21 +0000 (12:13 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Mon, 4 May 2015 20:49:58 +0000 (13:49 -0700)
Currently no 3.10 ES features (beyond 3.00 ES) are enabled.  That will
come later.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/glsl/glsl_parser_extras.cpp
src/glsl/glsl_parser_extras.h

index a8ba89eda3ab05b13b144b8587b8c453c98ce480..9e2f19f6388088b3f1d60412962b247bbf8b19ad 100644 (file)
@@ -143,9 +143,9 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
    this->num_user_structures = 0;
 
    /* supported_versions should be large enough to support the known desktop
-    * GLSL versions plus 2 GLES versions (ES2 & ES3)
+    * GLSL versions plus 3 GLES versions (ES 1.00, ES 3.00, and ES 3.10))
     */
-   STATIC_ASSERT((ARRAY_SIZE(known_desktop_glsl_versions) + 2) ==
+   STATIC_ASSERT((ARRAY_SIZE(known_desktop_glsl_versions) + 3) ==
                  ARRAY_SIZE(this->supported_versions));
 
    /* Populate the list of supported GLSL versions */
@@ -175,6 +175,11 @@ _mesa_glsl_parse_state::_mesa_glsl_parse_state(struct gl_context *_ctx,
       this->supported_versions[this->num_supported_versions].es = true;
       this->num_supported_versions++;
    }
+   if (_mesa_is_gles31(ctx)) {
+      this->supported_versions[this->num_supported_versions].ver = 310;
+      this->supported_versions[this->num_supported_versions].es = true;
+      this->num_supported_versions++;
+   }
 
    /* Create a string for use in error messages to tell the user which GLSL
     * versions are supported.
index 51f2bf5e000e862a841897ed11d6b985f4c7a301..5c0ee9b2fc3236d1f63cad02549513f60c252c45 100644 (file)
@@ -229,7 +229,7 @@ struct _mesa_glsl_parse_state {
    struct {
       unsigned ver;
       bool es;
-   } supported_versions[14];
+   } supported_versions[15];
 
    bool es_shader;
    unsigned language_version;