summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorFrancisco Jerez <[email protected]>2015-01-31 22:07:47 +0200
committerFrancisco Jerez <[email protected]>2015-05-04 17:44:16 +0300
commitb5994d24d821082965636a5fe6e94079975777d0 (patch)
tree27e244b0e7e71707a210fcd039f0cff0eea50ea2 /src/glsl/ast_to_hir.cpp
parent3f8558650d0db1f0f7a5a03cc781cbf2785cc2c8 (diff)
glsl: Forbid use of image qualifiers in declarations of type other than image.
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index da063d5606b..fa05c6565bc 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2369,6 +2369,14 @@ apply_image_qualifier_to_variable(const struct ast_type_qualifier *qual,
var->data.image_format = GL_NONE;
}
+ } else if (qual->flags.q.read_only ||
+ qual->flags.q.write_only ||
+ qual->flags.q.coherent ||
+ qual->flags.q._volatile ||
+ qual->flags.q.restrict_flag ||
+ qual->flags.q.explicit_image_format) {
+ _mesa_glsl_error(loc, state, "memory qualifiers may only be applied to "
+ "images");
}
}
@@ -2793,8 +2801,7 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
validate_matrix_layout_for_type(state, loc, var->type, var);
}
- if (var->type->contains_image())
- apply_image_qualifier_to_variable(qual, var, state, loc);
+ apply_image_qualifier_to_variable(qual, var, state, loc);
}
/**