aboutsummaryrefslogtreecommitdiffstats
path: root/src/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorPaul Berry <[email protected]>2013-08-12 06:39:23 -0700
committerPaul Berry <[email protected]>2013-08-13 20:02:54 -0700
commit336351e971d6232bbed11d9812ebf05341b6aa36 (patch)
tree8122c301e5de036fcc8f9c142e2413e3975ebb45 /src/glsl/ast_to_hir.cpp
parent3b837e637efcb64bdd1db1f1281b0e321524788d (diff)
glsl/ast: Check that geometry shader interface block inputs are arrays.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glsl/ast_to_hir.cpp')
-rw-r--r--src/glsl/ast_to_hir.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 49804b751e8..3610014a00c 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -4528,6 +4528,19 @@ ast_interface_block::hir(exec_list *instructions,
*/
assert(declared_variables.is_empty());
+ /* 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 (state->target == geometry_shader && !this->is_array &&
+ var_mode == ir_var_shader_in) {
+ _mesa_glsl_error(&loc, state, "geometry shader inputs must be arrays");
+ }
+
/* Page 39 (page 45 of the PDF) of section 4.3.7 in the GLSL ES 3.00 spec
* says:
*