Mesa (master): glsl/cs: Prohibit user-defined ins/outs in compute shaders.

Paul Berry stereotype441 at kemper.freedesktop.org
Wed Feb 5 17:26:00 UTC 2014


Module: Mesa
Branch: master
Commit: 5a79bdab3008a19a770b8b84fdf5582e72db72c9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=5a79bdab3008a19a770b8b84fdf5582e72db72c9

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Wed Jan  8 01:54:26 2014 -0800

glsl/cs: Prohibit user-defined ins/outs in compute shaders.

Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

---

 src/glsl/ast_to_hir.cpp |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index a55c969..c89a26b 100644
--- a/src/glsl/ast_to_hir.cpp
+++ b/src/glsl/ast_to_hir.cpp
@@ -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.




More information about the mesa-commit mailing list