summaryrefslogtreecommitdiff
path: root/src/glsl/ast_type.cpp
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-06-12 14:03:49 -0700
committerPaul Berry <stereotype441@gmail.com>2013-08-01 20:23:33 -0700
commit624b7bac76c3f70a3a110d114a3c1c327d3dad5f (patch)
treef0be97cc9ddfe6d4bd5762801e5f46801ea4077d /src/glsl/ast_type.cpp
parentf2e14238a79100f22ccdcdda2a2267ff9fc85655 (diff)
glsl: Parse the GLSL 1.50 GS layout qualifiers.
Limited semantic checking (compatibility between declarations, checking that they're in the right shader target, etc.) is done. v2: Remove stray debug printfs. v3 (Paul Berry <stereotype441@gmail.com>): Process input layout qualifiers at ast_to_hir time rather than at parse time, since certain error conditions depend on the relative ordering between input layout qualifiers, declarations, and calls to .length(). Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/glsl/ast_type.cpp')
-rw-r--r--src/glsl/ast_type.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/glsl/ast_type.cpp b/src/glsl/ast_type.cpp
index 38c3f8eb02c..ce6b6a77145 100644
--- a/src/glsl/ast_type.cpp
+++ b/src/glsl/ast_type.cpp
@@ -133,6 +133,25 @@ ast_type_qualifier::merge_qualifier(YYLTYPE *loc,
return false;
}
+ if (q.flags.q.prim_type) {
+ if (this->flags.q.prim_type && this->prim_type != q.prim_type) {
+ _mesa_glsl_error(loc, state,
+ "conflicting primitive type qualifiers used");
+ return false;
+ }
+ this->prim_type = q.prim_type;
+ }
+
+ if (q.flags.q.max_vertices) {
+ if (this->flags.q.max_vertices && this->max_vertices != q.max_vertices) {
+ _mesa_glsl_error(loc, state,
+ "geometry shader set conflicting max_vertices "
+ "(%d and %d)", this->max_vertices, q.max_vertices);
+ return false;
+ }
+ this->max_vertices = q.max_vertices;
+ }
+
if ((q.flags.i & ubo_mat_mask.flags.i) != 0)
this->flags.i &= ~ubo_mat_mask.flags.i;
if ((q.flags.i & ubo_layout_mask.flags.i) != 0)