glsl/cs: Prohibit user-defined ins/outs in compute shaders.
authorPaul Berry <stereotype441@gmail.com>
Wed, 8 Jan 2014 09:54:26 +0000 (01:54 -0800)
committerPaul Berry <stereotype441@gmail.com>
Wed, 5 Feb 2014 17:04:58 +0000 (09:04 -0800)
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/glsl/ast_to_hir.cpp

index a55c96942389ca4598a9efc1b2b385f2a7314b88..c89a26bf9108cad216ce204a761bdabe79ff1012 100644 (file)
@@ -2282,6 +2282,13 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
       var->data.mode = ir_var_uniform;
 
    if (!is_parameter && is_varying_var(var, state->stage)) {
+      /* User-defined ins/outs are not permitted in compute shaders. */
+      if (state->stage == MESA_SHADER_COMPUTE) {
+         _mesa_glsl_error(loc, state,
+                          "user-defined input and output variables are not "
+                          "permitted in compute shaders");
+      }
+
       /* This variable is being used to link data between shader stages (in
        * pre-glsl-1.30 parlance, it's a "varying").  Check that it has a type
        * that is allowed for such purposes.