summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJordan Justen <[email protected]>2013-03-09 13:01:13 -0800
committerJordan Justen <[email protected]>2013-05-23 09:37:11 -0700
commitd36cb3617c12808677f0963e1548e07e9347931c (patch)
tree8faac22433ea4867ca988bcaf1bb98ececf0f84c /src
parent6d3d974e379caadde53c5361e26384935c199769 (diff)
glsl parser: reject VS+in & FS+out interface blocks
Signed-off-by: Jordan Justen <[email protected]> Reviewed-by: Eric Anholt <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/glsl/glsl_parser.yy14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 0a2a77b8f16..dbc25a48405 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -1935,6 +1935,20 @@ basic_interface_block:
}
}
+ /* From the GLSL 1.50.11 spec, section 4.3.7 ("Interface Blocks"):
+ * "It is illegal to have an input block in a vertex shader
+ * or an output block in a fragment shader"
+ */
+ if ((state->target == vertex_shader) && $1.flags.q.in) {
+ _mesa_glsl_error(& @1, state,
+ "`in' interface block is not allowed for "
+ "a vertex shader\n");
+ } else if ((state->target == fragment_shader) && $1.flags.q.out) {
+ _mesa_glsl_error(& @1, state,
+ "`out' interface block is not allowed for "
+ "a fragment shader\n");
+ }
+
/* Since block arrays require names, and both features are added in
* the same language versions, we don't have to explicitly
* version-check both things.