summaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-04-10 07:04:33 -0700
committerPaul Berry <[email protected]>2013-08-01 20:22:48 -0700
commit05234e707bb811e3807d260c1c6cac59a4f1820f (patch)
tree97cbce97b0545e600ad314f2da4ed6c13e71b714 /src/glsl/ast_to_hir.cpp
parentfc5fa56c86df066514e1ca4eff16c1f179884188 (diff)
glsl: Require geometry shader inputs to be arrays.
Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 4b5645221a4..10c5425e8ee 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -2816,7 +2816,20 @@ ast_declarator_list::hir(exec_list *instructions,
"cannot have array type")) {
error_emitted = true;
}
- }
+ } else if (state->target == geometry_shader) {
+ /* From section 4.3.4 (Inputs) of the GLSL 1.50 spec:
+ *
+ * Geometry shader input variables get the per-vertex values
+ * written out by vertex shader output variables of the same
+ * names. Since a geometry shader operates on a set of
+ * vertices, each input varying variable (or input block, see
+ * interface blocks below) needs to be declared as an array.
+ */
+ if (!var->type->is_array()) {
+ _mesa_glsl_error(&loc, state,
+ "geometry shader inputs must be arrays");
+ }
+ }
}
/* Integer fragment inputs must be qualified with 'flat'. In GLSL ES,