diff options
author | Dave Airlie <[email protected]> | 2016-05-03 14:33:16 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-05-04 06:44:45 +1000 |
commit | 265fe9dce8727d8777153fa9846300051141a88e (patch) | |
tree | b862fc3f066d31804054bcbc820971a8eac71693 /src/compiler/glsl/ast_function.cpp | |
parent | 3110a0aa2304616bf996fdf019ad4457bed44dfd (diff) |
glsl: subroutine types cannot be used in constructors.
This fixes two of the cases in
GL43-CTS.shader_subroutine.subroutines_not_allowed_as_variables_constructors_and_argument_or_return_types
Reviewed-by: Iago Toral Quiroga <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ast_function.cpp')
-rw-r--r-- | src/compiler/glsl/ast_function.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_function.cpp b/src/compiler/glsl/ast_function.cpp index f50c7bf7b71..37fb3e790c4 100644 --- a/src/compiler/glsl/ast_function.cpp +++ b/src/compiler/glsl/ast_function.cpp @@ -1819,6 +1819,12 @@ ast_function_expression::hir(exec_list *instructions, return ir_rvalue::error_value(ctx); } + if (constructor_type->is_subroutine()) { + _mesa_glsl_error(& loc, state, "subroutine name cannot be a constructor `%s'", + constructor_type->name); + return ir_rvalue::error_value(ctx); + } + if (constructor_type->is_array()) { if (!state->check_version(120, 300, &loc, "array constructors forbidden")) { |