[Mesa-dev] [PATCH 2/2] glsl: fix 'shared' layout qualifier related regressions

Samuel Iglesias Gonsálvez siglesias at igalia.com
Thu Nov 12 05:22:40 PST 2015


Commit 8b28b35 added 'shared' as a keyword for compute shaders
but it broke the existing 'shared' layout qualifier support for
uniform and shader storage blocks.

This patch fixes 578 dEQP-GLES31.functional.ssbo.* tests.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
---
 src/glsl/glsl_parser.yy | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 4ac8e45..592630e 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1199,8 +1199,6 @@ layout_qualifier_id:
       if (!$$.flags.i && state->has_uniform_buffer_objects()) {
          if (match_layout_qualifier($1, "std140", state) == 0) {
             $$.flags.q.std140 = 1;
-         } else if (match_layout_qualifier($1, "shared", state) == 0) {
-            $$.flags.q.shared = 1;
          } else if (match_layout_qualifier($1, "std430", state) == 0) {
             $$.flags.q.std430 = 1;
          } else if (match_layout_qualifier($1, "column_major", state) == 0) {
@@ -1618,6 +1616,15 @@ layout_qualifier_id:
                             "layout qualifier `%s' is used", $1);
       }
    }
+   | SHARED
+   {
+      memset(& $$, 0, sizeof($$));
+
+      if (!$$.flags.i && state->has_uniform_buffer_objects()) {
+	 $$.flags.q.shared = 1;
+	 $$.flags.q.shared_storage = 0;
+      }
+   }
    ;
 
 /* This is a separate language rule because we parse these as tokens
-- 
2.5.0



More information about the mesa-dev mailing list