summaryrefslogtreecommitdiffstats
path: root/src/compiler/glsl/ast_to_hir.cpp
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-05-23 12:14:01 +1000
committerDave Airlie <airlied@redhat.com>2016-05-30 11:25:30 +1000
commit6effdce92e89890f7276d406607241b7e372d1be (patch)
tree55704daed47825d5e476a4b4e1d08b1e613c5493 /src/compiler/glsl/ast_to_hir.cpp
parentdb2a35193fc8e08b2bb54bf9f6150a9fc054b178 (diff)
downloadexternal_mesa3d-6effdce92e89890f7276d406607241b7e372d1be.zip
external_mesa3d-6effdce92e89890f7276d406607241b7e372d1be.tar.gz
external_mesa3d-6effdce92e89890f7276d406607241b7e372d1be.tar.bz2
glsl/ast: subroutineTypes can't be returned from functions.
These types can't be returned. This fixes: GL43-CTS.shader_subroutine.subroutines_not_allowed_as_variables_constructors_and_argument_or_return_types for the return type case. Reviewed-by: Chris Forbes <chrisforbes@google.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src/compiler/glsl/ast_to_hir.cpp')
-rw-r--r--src/compiler/glsl/ast_to_hir.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp
index d6f9a75..ccacd26 100644
--- a/src/compiler/glsl/ast_to_hir.cpp
+++ b/src/compiler/glsl/ast_to_hir.cpp
@@ -5400,6 +5400,15 @@ ast_function::hir(exec_list *instructions,
name);
}
+ /**/
+ if (return_type->is_subroutine()) {
+ YYLTYPE loc = this->get_location();
+ _mesa_glsl_error(&loc, state,
+ "function `%s' return type can't be a subroutine type",
+ name);
+ }
+
+
/* Create an ir_function if one doesn't already exist. */
f = state->symbols->get_function(name);
if (f == NULL) {