glsl: fix error when using format qualifiers with non-image types
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 26 Apr 2017 16:50:14 +0000 (18:50 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Fri, 28 Apr 2017 08:43:04 +0000 (10:43 +0200)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
src/compiler/glsl/ast_to_hir.cpp

index ef6f6cc08d2080cb35a40ff0f1452ff4a6c4ffde..425da639c71875aeb09b3d170e8254319317af5c 100644 (file)
@@ -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;
    }