summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_type.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-07-12 22:34:19 -0700
committerKenneth Graunke <kenneth@whitecape.org>2013-07-18 16:57:21 -0700
commit7cef2b22b84aecf9cddf65a3a054fd39e2e9b369 (patch)
tree4cc861434c0a9de37d1dcc9daecb6a259bf5e844 /src/glsl/ast_type.cpp
parent7ce5c6b2147f9af524f4073b6ee3b29c0a5a1522 (diff)
downloadexternal_mesa3d-7cef2b22b84aecf9cddf65a3a054fd39e2e9b369.zip
external_mesa3d-7cef2b22b84aecf9cddf65a3a054fd39e2e9b369.tar.gz
external_mesa3d-7cef2b22b84aecf9cddf65a3a054fd39e2e9b369.tar.bz2
glsl: Add a new ast_type_qualifier::has_layout() method.
This makes it easy to check if any layout qualifiers are set. 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.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
index be84550..4e870a7 100644
--- a/src/glsl/ast_type.cpp
+++ b/src/glsl/ast_type.cpp
@@ -56,6 +56,24 @@ bool ast_type_qualifier::has_interpolation() const
|| this->flags.q.noperspective;
}
+bool
+ast_type_qualifier::has_layout() const
+{
+ return this->flags.q.origin_upper_left
+ || this->flags.q.pixel_center_integer
+ || this->flags.q.depth_any
+ || this->flags.q.depth_greater
+ || this->flags.q.depth_less
+ || this->flags.q.depth_unchanged
+ || this->flags.q.std140
+ || this->flags.q.shared
+ || this->flags.q.column_major
+ || this->flags.q.row_major
+ || this->flags.q.packed
+ || this->flags.q.explicit_location
+ || this->flags.q.explicit_index;
+}
+
const char*
ast_type_qualifier::interpolation_string() const
{