[Mesa-dev] [PATCH 1/3] glsl: fix error when using format qualifiers with non-image types

Samuel Pitoiset samuel.pitoiset at gmail.com
Wed Apr 26 16:50:14 UTC 2017


Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
---
 src/compiler/glsl/ast_to_hir.cpp | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index aeb223db9e..e26bd3f047 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -3304,11 +3304,15 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual,
           qual->flags.q.write_only ||
           qual->flags.q.coherent ||
           qual->flags.q._volatile ||
-          qual->flags.q.restrict_flag ||
-          qual->flags.q.explicit_image_format) {
+          qual->flags.q.restrict_flag) {
          _mesa_glsl_error(loc, state, "memory qualifiers may only be applied "
                           "to images");
       }
+
+      if (qual->flags.q.explicit_image_format) {
+         _mesa_glsl_error(loc, state, "format layout qualifiers may only be "
+                          "applied to images");
+      }
       return;
    }
 
-- 
2.12.2



More information about the mesa-dev mailing list