Mesa (master): glsl/es3.1: Allow explicit uniform locations in GLSL ES 3.10

Ian Romanick idr at kemper.freedesktop.org
Mon May 4 21:26:43 UTC 2015


Module: Mesa
Branch: master
Commit: 2dcc535300d57a8ec50337df54438faa17a82745
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2dcc535300d57a8ec50337df54438faa17a82745

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Tue Apr 28 12:38:46 2015 -0700

glsl/es3.1: Allow explicit uniform locations in GLSL ES 3.10

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

---

 src/glsl/glsl_parser_extras.h |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index 5c0ee9b..b3c8a1d 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -175,11 +175,15 @@ struct _mesa_glsl_parse_state {
                                                 const ir_variable *)
    {
       if (!this->has_explicit_attrib_location() ||
-          !this->ARB_explicit_uniform_location_enable) {
+          !this->has_explicit_uniform_location()) {
+         const char *const requirement = this->es_shader
+            ? "GLSL ES 310"
+            : "GL_ARB_explicit_uniform_location and either "
+              "GL_ARB_explicit_attrib_location or GLSL 330.";
+
          _mesa_glsl_error(locp, this,
-                          "uniform explicit location requires "
-                          "GL_ARB_explicit_uniform_location and either "
-                          "GL_ARB_explicit_attrib_location or GLSL 330.");
+                          "uniform explicit location requires %s",
+                          requirement);
          return false;
       }
 
@@ -201,6 +205,11 @@ struct _mesa_glsl_parse_state {
       return ARB_explicit_attrib_location_enable || is_version(330, 300);
    }
 
+   bool has_explicit_uniform_location() const
+   {
+      return ARB_explicit_uniform_location_enable || is_version(430, 310);
+   }
+
    bool has_uniform_buffer_objects() const
    {
       return ARB_uniform_buffer_object_enable || is_version(140, 300);




More information about the mesa-commit mailing list