[Mesa-dev] [PATCH 09/20] glsl/es3.1: Allow 3.10 ES shaders in a GLES 3.1 context

Ian Romanick idr at freedesktop.org
Wed Apr 29 16:26:00 PDT 2015


From: Ian Romanick <ian.d.romanick at intel.com>

Currently no 3.10 ES features (beyond 3.00 ES) are enabled.  That will
come later.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glsl/glsl_parser_extras.cpp | 9 +++++++--
 src/glsl/glsl_parser_extras.h   | 2 +-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
index 0aa3c54..91f225e 100644
--- a/src/glsl/glsl_parser_extras.cpp
+++ b/src/glsl/glsl_parser_extras.cpp
@@ -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.
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 382c200..960f957 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -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;
-- 
2.1.0



More information about the mesa-dev mailing list