summaryrefslogtreecommitdiff
path: root/src/glsl/ast_type.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-07-12 22:36:31 -0700
committerKenneth Graunke <kenneth@whitecape.org>2013-07-18 16:57:22 -0700
commiteb30af51d68e3cc137dd640e57c81bdda1aae527 (patch)
treeec22202e69456987f359c353dd8b6f63fe9a2c1f /src/glsl/ast_type.cpp
parent7cef2b22b84aecf9cddf65a3a054fd39e2e9b369 (diff)
glsl: Add a new ast_type_qualifier::has_storage() method.
This makes it easy to check if any storage qualifiers are set. "centroid" is not considered a storage qualifier. In the old language rules, you can't specify "centroid" by itself; it's always "centroid in", "centroid out", or "centroid varying." So one of the other storage qualifiers will always be set; there's no need to specifically check for centroid. In the new 4.20 rules, centroid is an auxiliary storage qualifier, not a storage qualifier. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'src/glsl/ast_type.cpp')
-rw-r--r--src/glsl/ast_type.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
index 4e870a70742..2e55b76762b 100644
--- a/src/glsl/ast_type.cpp
+++ b/src/glsl/ast_type.cpp
@@ -74,6 +74,17 @@ ast_type_qualifier::has_layout() const
|| this->flags.q.explicit_index;
}
+bool
+ast_type_qualifier::has_storage() const
+{
+ return this->flags.q.constant
+ || this->flags.q.attribute
+ || this->flags.q.varying
+ || this->flags.q.in
+ || this->flags.q.out
+ || this->flags.q.uniform;
+}
+
const char*
ast_type_qualifier::interpolation_string() const
{